-
Notifications
You must be signed in to change notification settings - Fork 264
170 lines (164 loc) · 5.48 KB
/
Release.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: 'Prepare Release'
on:
workflow_dispatch:
push:
tags:
- latest/v*
- stable/v*
jobs:
'MacOS':
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: ' Building...'
run: |
npm install
npm run package:mac
- name: set env
run: |
echo "APP_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
echo ${{ env.APP_VERSION }}
- name: 'Packing DMG...'
if: success()
run: npx electron-installer-dmg 'release-builds/Time to Leave-darwin-universal/Time to Leave.app' time-to-leave-${{ env.APP_VERSION }} --out 'packages/' --icon=assets/icon-mac.icns
- name: 'Release to GH'
if: success()
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: 'packages/**.dmg'
artifactContentType: application/x-apple-diskimage
draft: true
tag: ${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
# Only update body on Release Notes Action
omitBody: true
omitBodyDuringUpdate: true
'Linux':
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: ' Building...'
run: |
npm install
npm run package:deb
- name: set env
run: |
echo "APP_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
echo ${{ env.APP_VERSION }}
- name: 'Packing DEB...'
if: success()
run: npx electron-installer-debian --src 'release-builds/time-to-leave-linux-x64/' --dest 'packages/' --arch amd64 --icon=assets/ttl.png --verbose
- name: 'Renaming DEB...'
if: success()
# Usual format is 'time-to-leave_2.0.1_amd64.deb'. Consistent expected name is 'time-to-leave-2.0.1-amd64.deb'
run: for file in packages/**.deb; do mv -- "$file" "${file//_/-}"; done
- name: 'Release to GH'
if: success()
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: 'packages/**.deb'
artifactContentType: application/vnd.debian.binary-package
draft: true
tag: ${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
# Only update body on Release Notes Action
omitBody: true
omitBodyDuringUpdate: true
- name: 'Packing RPM'
if: success()
run: |
sudo apt install -yqq rpm
npx electron-installer-redhat --src 'release-builds/time-to-leave-linux-x64/' --dest 'packages/' --arch amd64 --icon=assets/ttl.png --verbose
- name: 'Renaming RPM...'
if: success()
# Usual format is 'time-to-leave-2.0.1-1.amd64.rpm'. Consistent expected name is 'time-to-leave-2.0.1-amd64.rpm'
run: for file in packages/**.rpm; do mv -- "$file" "${file//-1.amd64/-amd64}"; done
- name: 'Release to GH'
if: success()
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: 'packages/**.rpm'
artifactContentType: application/x-redhat-package-manager
draft: true
tag: ${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
# Only update body on Release Notes Action
omitBody: true
omitBodyDuringUpdate: true
'Windows':
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: 'Building...'
run: |
npm install
npm run package:win
- name: set env
run: |
echo "APP_VERSION=$(node -p "require('./package.json').version")" >> $env:GITHUB_ENV
- name: 'Packing EXE, etc'
if: success()
run: npm run setup:win
- name: 'Renaming EXE...'
shell: pwsh
if: success()
# Usual format is 'TimeToLeaveInstaller.exe'. Consistent expected name is 'time-to-leave-2.0.1-installer.exe'
run: |
$newFileName = "time-to-leave-${{ env.APP_VERSION }}-installer.exe"
Rename-Item -Path "packages/TimeToLeaveInstaller.exe" -NewName $newFileName
- name: 'Release EXE to GH'
if: success()
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: 'packages/**.exe'
artifactContentType: application/x-executable
draft: true
tag: ${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
# Only update body on Release Notes Action
omitBody: true
omitBodyDuringUpdate: true
'ReleaseNotes':
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: ' Building...'
run: |
npm install
- name: set env
run: |
echo "APP_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
echo ${{ env.APP_VERSION }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Parse release information
run: |
python scripts/update_release.py -changelog-file changelog.md -version ${{ env.APP_VERSION }} -output-file release_notes.md
- name: 'Release to GH'
if: success()
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: true
tag: ${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
# Only update body on Release Notes Action
bodyFile: 'release_notes.md'