forked from espanso/espanso
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (170 loc) · 6.49 KB
/
dev-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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Huge thanks to Alacritty, as their configuration served as a starting point for this one!
# See: https://github.com/alacritty/alacritty
name: Dev Release
on:
push:
branches:
- dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_TERM_COLOR: always
jobs:
extract-version:
name: extract-version
runs-on: ubuntu-latest
outputs:
espanso_version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v2
- name: "Extract version"
id: "version"
run: |
ESPANSO_VERSION=$(grep '^version' espanso/Cargo.toml | awk -F '"' '{ print $2 }')
echo version: $ESPANSO_VERSION
echo "::set-output name=version::v$ESPANSO_VERSION"
windows:
needs: ["extract-version"]
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Print target version
run: |
echo Using version ${{ needs.extract-version.outputs.espanso_version }}
- name: Install rust-script and cargo-make
run: |
cargo install rust-script --version "0.7.0"
cargo install --force cargo-make --version 0.37.5
- name: Test
run: cargo make --profile release -- test-binary
- name: Build resources
run: cargo make --profile release -- build-windows-resources
- name: Build installer
run: cargo make --profile release --skip-tasks build-windows-resources -- build-windows-installer
- name: Build portable mode archive
run: cargo make --profile release --skip-tasks build-windows-resources -- build-windows-portable
- name: Create portable mode archive
shell: powershell
run: |
Rename-Item target/windows/portable espanso-portable
Compress-Archive target/windows/espanso-portable target/windows/Espanso-Win-Portable-x86_64.zip
- name: Calculate hashes
shell: powershell
run: |
Get-FileHash target/windows/Espanso-Win-Portable-x86_64.zip -Algorithm SHA256 | select-object -ExpandProperty Hash > target/windows/Espanso-Win-Portable-x86_64.zip.sha256.txt
Get-FileHash target/windows/installer/Espanso-Win-Installer-x86_64.exe -Algorithm SHA256 | select-object -ExpandProperty Hash > target/windows/installer/Espanso-Win-Installer-x86_64.exe.sha256.txt
- uses: actions/upload-artifact@v2
name: "Upload artifacts"
with:
name: Windows Artifacts
path: |
target/windows/installer/Espanso-Win-Installer-x86_64.exe
target/windows/Espanso-Win-Portable-x86_64.zip
target/windows/installer/Espanso-Win-Installer-x86_64.exe.sha256.txt
target/windows/Espanso-Win-Portable-x86_64.zip.sha256.txt
linux-x11:
needs: ["extract-version"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Print target version
run: |
echo Using version ${{ needs.extract-version.outputs.espanso_version }}
- name: Build docker image
run: |
sudo docker build -t espanso-ubuntu . -f .github/scripts/ubuntu/Dockerfile
- name: Build AppImage
run: |
sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/ubuntu/build_appimage.sh
- uses: actions/upload-artifact@v2
name: "Upload artifacts"
with:
name: Linux X11 Artifacts
path: |
Espanso-X11.AppImage
Espanso-X11.AppImage.sha256.txt
linux-deb:
needs: ["extract-version"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Print target version
run: |
echo Using version ${{ needs.extract-version.outputs.espanso_version }}
- name: Build docker image
run: |
sudo docker build -t espanso-ubuntu . -f .github/scripts/ubuntu/Dockerfile
- name: Build Deb packages
run: |
sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/ubuntu/build_deb.sh
- uses: actions/upload-artifact@v2
name: "Upload artifacts"
with:
name: Ubuntu-Debian Artifacts
path: |
espanso-debian-x11-amd64.deb
espanso-debian-wayland-amd64.deb
macos-intel:
needs: ["extract-version"]
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Print target version
run: |
echo Using version ${{ needs.extract-version.outputs.espanso_version }}
- name: Install rust-script and cargo-make
run: |
cargo install rust-script --version "0.7.0"
cargo install --force cargo-make --version 0.37.5
- name: Test
run: cargo make --profile release -- test-binary
env:
MACOSX_DEPLOYMENT_TARGET: "10.13"
- name: Build
run: cargo make --profile release -- create-bundle
env:
MACOSX_DEPLOYMENT_TARGET: "10.13"
- name: Create ZIP archive
run: |
ditto -c -k --sequesterRsrc --keepParent target/mac/Espanso.app Espanso-Mac-Intel.zip
- name: Calculate hashes
run: |
shasum -a 256 Espanso-Mac-Intel.zip > Espanso-Mac-Intel.zip.sha256.txt
- uses: actions/upload-artifact@v2
name: "Upload artifacts"
with:
name: Mac Intel Artifacts
path: |
Espanso-Mac-Intel.zip
Espanso-Mac-Intel.zip.sha256.txt
macos-m1:
needs: ["extract-version"]
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Print target version
run: |
echo Using version ${{ needs.extract-version.outputs.espanso_version }}
- name: Install rust target
run: rustup update && rustup target add aarch64-apple-darwin
- name: Install rust-script and cargo-make
run: |
cargo install rust-script --version "0.7.0"
cargo install --force cargo-make --version 0.37.5
- name: Build
run: cargo make --env BUILD_ARCH=aarch64-apple-darwin --profile release -- create-bundle
- name: Create ZIP archive
run: |
ditto -c -k --sequesterRsrc --keepParent target/mac/Espanso.app Espanso-Mac-M1.zip
- name: Calculate hashes
run: |
shasum -a 256 Espanso-Mac-M1.zip > Espanso-Mac-M1.zip.sha256.txt
- uses: actions/upload-artifact@v2
name: "Upload artifacts"
with:
name: Mac M1 Artifacts
path: |
Espanso-Mac-M1.zip
Espanso-Mac-M1.zip.sha256.txt