Skip to content

Commit 5b639ad

Browse files
committed
simplify build
1 parent a32db09 commit 5b639ad

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

.github/workflows/build.yml

+16-18
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414

1515
jobs:
1616
build:
17-
name: ${{ matrix.config.name }} | Release
17+
name: ${{ matrix.config.name }} | ${{ matrix.config.build_type }}
1818
runs-on: ${{ matrix.config.os }}
1919
strategy:
2020
fail-fast: false
@@ -26,23 +26,26 @@ jobs:
2626
project: Wpf,
2727
runtime: win-x86,
2828
framework: net5.0-windows,
29-
is_single_file: "false"
29+
is_single_file: "false",
30+
build_type: Release
3031
}
3132
- {
3233
name: Linux,
3334
os: ubuntu-latest,
3435
project: Gtk,
3536
runtime: linux-x64,
3637
framework: net5.0,
37-
is_single_file: "true"
38+
is_single_file: "true",
39+
build_type: Release
3840
}
3941
- {
4042
name: macOS,
4143
os: macos-latest,
4244
project: Mac,
4345
runtime: osx-x64,
4446
framework: net5.0,
45-
is_single_file: "true"
47+
is_single_file: "true",
48+
build_type: Release
4649
}
4750

4851
steps:
@@ -59,15 +62,14 @@ jobs:
5962

6063
- name: Publish
6164
run: dotnet publish ${{ env.app_name }}/${{ env.app_name }}.${{ matrix.config.project }}/${{ env.app_name }}.${{ matrix.config.project }}.csproj
62-
--configuration Release
65+
--configuration ${{ matrix.config.build_type }}
6366
--output ${{ env.publish_folder }}
6467
--self-contained true
6568
-p:PublishSingleFile=${{ matrix.config.is_single_file }}
6669
--runtime ${{ matrix.config.runtime }}
6770
--framework ${{ matrix.config.framework }}
6871

6972
- name: Create Package
70-
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
7173
shell: bash
7274
run: |
7375
filename=${{ env.app_name }}-${{ matrix.config.runtime }}
@@ -78,17 +80,10 @@ jobs:
7880
fi
7981
8082
- uses: actions/upload-artifact@v2
81-
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
8283
with:
83-
name: ${{ matrix.config.runtime }} Release
84+
name: ${{ matrix.config.runtime }} ${{ matrix.config.build_type }}
8485
path: ${{ env.app_name }}-${{ matrix.config.runtime }}.zip
8586

86-
- uses: actions/upload-artifact@v2
87-
if: (github.event_name == 'push' || github.event_name == 'pull_request')
88-
with:
89-
name: ${{ matrix.config.runtime }} Release
90-
path: ${{ env.publish_folder }}
91-
9287
- name: List Build Directory
9388
if: always()
9489
shell: bash
@@ -105,13 +100,16 @@ jobs:
105100
matrix:
106101
config:
107102
- {
108-
runtime: win-x86
103+
runtime: win-x86,
104+
build_type: Release
109105
}
110106
- {
111-
runtime: linux-x64
107+
runtime: linux-x64,
108+
build_type: Release
112109
}
113110
- {
114-
runtime: osx-x64
111+
runtime: osx-x64,
112+
build_type: Release
115113
}
116114
steps:
117115
- name: Get release
@@ -123,7 +121,7 @@ jobs:
123121
- name: Download artifacts
124122
uses: actions/download-artifact@v2
125123
with:
126-
name: ${{ matrix.config.runtime }} Release
124+
name: ${{ matrix.config.runtime }} ${{ matrix.config.build_type }}
127125

128126
- name: Upload Release Assets
129127
uses: actions/upload-release-asset@v1

0 commit comments

Comments
 (0)