-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (113 loc) · 3.39 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
name: release
on: push
env:
CARGO_TERM_COLOR: always
jobs:
gui-builds:
strategy:
matrix:
os: [ubuntu, windows, macos]
arch: [x86_64]
include:
- os: macos
arch: arm
triple: aarch64-apple-darwin
runs-on: ${{ format('{0}-latest', matrix.os) }}
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@v1
if: ${{ matrix.os == 'ubuntu' }}
with:
packages: binaryen \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
libxdo-dev
- name: Download dependencies (mac)
if: ${{ matrix.os == 'macos' }}
run: |
brew install binaryen
- name: Download dependencies (windows)
if: ${{ matrix.os == 'windows' }}
run: |
choco install sed
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
scoop install main/binaryen
- uses: ilammy/setup-nasm@v1
- uses: dtolnay/rust-toolchain@stable
if: ${{ matrix.triple == null }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ matrix.triple }}
with:
target: ${{ matrix.triple }}
- uses: Swatinem/rust-cache@v2
- uses: cargo-bins/cargo-binstall@main
- name: Download dioxus
run:
cargo binstall --no-confirm [email protected]
- name: Fix paths (windows)
if: ${{ matrix.os == 'windows' }}
run: |
sed -i 's;/;\\\\;g' Dioxus.toml # Filesystem paths...
- name: Build artifacts (cross-compile)
if: ${{ matrix.triple }}
run: |
dx bundle --release --target '${{ matrix.triple }}'
mv 'dist/bundle/macos/sw8s_rgui.app' 'dist/bundle/macos/sw8s_rgui_${{ matrix.triple }}.app' || true
- name: Build artifacts
if: ${{ matrix.triple == null }}
run: |
dx bundle --release
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}-${{ matrix.os }}-gui
path: |
dist/bundle/deb/*.deb
dist/bundle/appimage/*.AppImage
dist/bundle/macos/*.app
dist/bundle/dmg/*.dmg
dist/bundle/msi/*.msi
dist/bundle/nsis/*.exe
retention-days: 1
release_info:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: actions/upload-artifact@v4
with:
name: RELEASE.txt
path: RELEASE.txt
retention-days: 1
bundle:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [
gui-builds,
release_info
]
steps:
- uses: actions/download-artifact@v4
with:
pattern: '!RELEASE.txt'
- name: Unpack directories
run: |
find -mindepth 2 -maxdepth 2 -type d -exec sh -c 'mv "$1"/* .' shell {} \;
find -type d -iname '*.app' -exec sh -c 'zip -r "$1".zip "$1"' shell {} \;
find -mindepth 1 -maxdepth 1 -type d -exec sh -c 'rm -rf "$1"' shell {} \;
- name: Calculate checksums
run: |
sha512sum * > sums.txt
- name: Move artifacts to subfolder
run: |
shopt -s extglob
mkdir artifacts
mv !(artifacts) artifacts
- uses: actions/download-artifact@v4
with:
name: RELEASE.txt
- uses: softprops/action-gh-release@v1
with:
files: artifacts/**
generate_release_notes: true
body_path: RELEASE.txt