-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (107 loc) Β· 4.32 KB
/
release-desktop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: DeckPad Desktop Release
on: push
jobs:
# check version between last tag and package.json - if version not change then the build will fail (correct way to not continue wasting build time)
version:
name: Check version updates
runs-on: ubuntu-latest
outputs:
new: ${{ steps.version_check.outputs.versionChanged }}
v: v${{ steps.version_check.outputs.rawVersion }}
tag: ${{ steps.version_check.outputs.releaseVersion }}
steps:
- uses: actions/checkout@v2
- run: git fetch --all --tags
- name: Check Release Version
id: version_check
uses: thebongy/version-check@v1
with:
file: ./packages/desktop/package.json
tagFormat: desktop-v${version}
failBuild: false
- name:
run: echo "DeckPad Desktop Version ${{steps.version_check.outputs.releaseVersion}}"
# generate build artifacts
artifacts:
runs-on: ${{ matrix.target.os }}
needs: version
if: needs.version.outputs.new == 'true'
defaults:
run:
working-directory: ./packages/desktop
strategy:
matrix:
target: [
{ 'os': 'windows-latest', 'system': 'win', 'arch': 'amd64', 'ext': 'exe' },
{ 'os': 'macos-latest', 'system': 'mac', 'arch': 'amd64', 'ext': 'dmg' },
# { 'os': 'macos-latest', 'system': 'mac', 'arch': 'arm64', 'ext': 'dmg' },
{ 'os': 'ubuntu-latest', 'system': 'linux', 'arch': 'amd64', 'ext': 'AppImage' },
# { 'os': 'ubuntu-latest', 'system': 'linux', 'arch': '386', 'ext': 'dmg' },
]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v2
with:
node-version: 16
- name: Yarn install
run: yarn install --network-timeout 1000000
- name: Yarn release - Build nextron desktop app
run: yarn run release
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: DeckPad_${{ matrix.target.system }}.${{ matrix.target.ext }}
path: ./packages/desktop/dist/DeckPad_${{ matrix.target.system }}.${{ matrix.target.ext }}
# create release tag from version
release:
name: Create Desktop Release
runs-on: ubuntu-latest
needs: [ version, artifacts ]
if: needs.version.outputs.new == 'true'
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
- name: Create Desktop Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.version.outputs.tag }}
release_name: Desktop ${{ needs.version.outputs.v }}
draft: false
prerelease: false
# Add all the builds as assets to the release
add:
runs-on: ${{ matrix.target.os }}
needs: [ version, artifacts, release ]
if: needs.version.outputs.new == 'true'
strategy:
matrix:
target: [
{ 'os': 'windows-latest', 'system': 'win', 'arch': 'amd64', 'ext': 'exe' },
{ 'os': 'macos-latest', 'system': 'mac', 'arch': 'amd64', 'ext': 'dmg' },
# { 'os': 'macos-latest', 'system': 'mac', 'arch': 'arm64', 'ext': 'dmg' },
{ 'os': 'ubuntu-latest', 'system': 'linux', 'arch': 'amd64', 'ext': 'AppImage' },
# { 'os': 'ubuntu-latest', 'system': 'linux', 'arch': '386', 'ext': 'dmg' },
]
steps:
- uses: actions/checkout@v2
- name: Download Artifact
id: download
uses: actions/download-artifact@v2
with:
name: DeckPad_${{ matrix.target.system }}.${{ matrix.target.ext }}
- name: Upload Artifact to Desktop Release
uses: Fhwang0926/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_name: DeckPad_${{ matrix.target.system }}.${{ matrix.target.ext }}
# asset_path: ./packages/desktop/dist/DeckPad_${{ matrix.target.system }}.${{ matrix.target.ext }}
# asset_name: DeckPad_${{ matrix.target.system }}.${{ matrix.target.ext }}
# asset_content_type: application/zip