Skip to content

Commit e213d95

Browse files
committed
Combine release versions build to single step
1 parent 88cbc90 commit e213d95

File tree

1 file changed

+28
-34
lines changed

1 file changed

+28
-34
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,28 @@ on:
66
- 'v*'
77

88
jobs:
9-
build_windows:
10-
name: Build Windows
11-
runs-on: windows-latest
9+
build:
10+
name: Build Version
11+
strategy:
12+
max-parallel: 4
13+
matrix:
14+
file_type: [ msi, dmg ]
15+
include:
16+
- file_type: msi
17+
op: windows-latest
18+
output_dir: windows
19+
- file_type: dmg
20+
op: macos-latest
21+
output_dir: macOS
22+
package_args: --no-sign
23+
runs-on: ${{ matrix.op }}
1224
steps:
1325
- name: Checkout code
1426
uses: actions/checkout@master
27+
- name: Set up Python 3.8
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: 3.8
1531
- name: Install briefcase
1632
run: |
1733
python -m pip install --upgrade pip
@@ -21,38 +37,16 @@ jobs:
2137
briefcase create --no-input
2238
- name: Briefcase package
2339
run: |
24-
briefcase package
25-
- name: Upload msi
26-
uses: actions/upload-artifact@v2
27-
with:
28-
name: msi
29-
path: windows/*.msi
30-
31-
build_macos:
32-
name: Build macOS
33-
runs-on: macos-latest
34-
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@master
37-
- name: Install briefcase
38-
run: |
39-
python3 -m pip install --upgrade pip
40-
pip3 install briefcase
41-
- name: Briefcase create
42-
run: |
43-
briefcase create --no-input
44-
- name: Briefcase package
45-
run: |
46-
briefcase package --no-sign
47-
- name: Upload dmg
40+
briefcase package ${{ matrix.package_args }}
41+
- name: Upload artifact
4842
uses: actions/upload-artifact@v2
4943
with:
50-
name: dmg
51-
path: macOS/*.dmg
44+
name: ${{ matrix.file_type }}
45+
path: ${{ matrix.output_dir }}/*.${{ matrix.file_type }}
5246

5347
create_release:
5448
name: Create Release
55-
needs: [build_windows, build_macos]
49+
needs: [build]
5650
runs-on: ubuntu-latest
5751
steps:
5852
- name: Create Release
@@ -79,14 +73,14 @@ jobs:
7973
run: |
8074
MSI_ARTIFACT_PATHNAME=$(ls windows/*.msi | head -n 1)
8175
MSI_ARTIFACT_NAME=$(basename $MSI_ARTIFACT_PATHNAME)
82-
echo ::set-env name=MSI_ARTIFACT_NAME::${MSI_ARTIFACT_NAME}
83-
echo ::set-env name=MSI_ARTIFACT_PATHNAME::${MSI_ARTIFACT_PATHNAME}
76+
echo "MSI_ARTIFACT_NAME=${MSI_ARTIFACT_NAME}" >> $GITHUB_ENV
77+
echo "MSI_ARTIFACT_PATHNAME=${MSI_ARTIFACT_PATHNAME}" >> $GITHUB_ENV
8478
- name: Get Name of DMG Artifact
8579
run: |
8680
DMG_ARTIFACT_PATHNAME=$(ls macOS/*.dmg | head -n 1)
8781
DMG_ARTIFACT_NAME=$(basename $DMG_ARTIFACT_PATHNAME)
88-
echo ::set-env name=DMG_ARTIFACT_NAME::${DMG_ARTIFACT_NAME}
89-
echo ::set-env name=DMG_ARTIFACT_PATHNAME::${DMG_ARTIFACT_PATHNAME}
82+
echo "DMG_ARTIFACT_NAME=${DMG_ARTIFACT_NAME}" >> $GITHUB_ENV
83+
echo "DMG_ARTIFACT_PATHNAME=${DMG_ARTIFACT_PATHNAME}" >> $GITHUB_ENV
9084
- name: Upload MSI Asset
9185
id: upload-msi-asset
9286
uses: actions/upload-release-asset@v1

0 commit comments

Comments
 (0)