-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (118 loc) · 4.68 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
name: Release
on:
push:
branches: ['main']
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: Wait on checks
uses: poseidon/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git config user.name github-actions
git config user.email [email protected]
git config --global user.email [email protected]
git config --global user.name github-actions
- uses: dtolnay/rust-toolchain@stable
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-edit
- uses: volta-cli/action@v4
- name: Bump
id: release
uses: cocogitto/cocogitto-action@main
with:
check-latest-tag-only: true
release: true
git-user: 'github-actions'
git-user-email: '[email protected]'
- name: Generate Changelog
run: cog changelog --at ${{ steps.release.outputs.version }} -t full_hash > GITHUB_CHANGELOG.md
- name: Upload github release
uses: softprops/action-gh-release@v1
with:
body_path: GITHUB_CHANGELOG.md
tag_name: ${{ steps.release.outputs.version }}
build:
name: Build - ${{ matrix.platform }}
needs: [release]
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [macos-latest, windows-latest, ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
shared-key: whooosh-${{ matrix.platform }}
workspaces: src-tauri
- uses: volta-cli/action@v4
- uses: dtolnay/rust-toolchain@stable
- if: matrix.platform == 'ubuntu-20.04'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
version: 1.0
- run: yarn install --immutable
- run: yarn tauri build --ci
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.platform }}
path: src-tauri/target/release/bundle
retention-days: 7
upload_to_release:
needs: [build]
name: Publish binaries
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: WyriHaximus/[email protected]
id: get-latest-tag
- uses: actions/download-artifact@v4
- run: ls -R
- name: Copy artifacts to archive
run: |
mv artifact-macos-latest macos
chmod +x -R macos
cp -r LICENSE macos/LICENSE
tar -czf macos.tar.gz macos/*
mv artifact-windows-latest windows
chmod +x -R windows
cp -r LICENSE windows/LICENSE
tar -czf windows.tar.gz windows/*
mv artifact-ubuntu-20.04 linux
chmod +x -R linux
cp -r LICENSE linux/LICENSE
tar -czf linux.tar.gz linux/*
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: macos.tar.gz
tag: ${{ steps.get-latest-tag.outputs.tag }}
asset_name: macos-${{ github.sha }}.tar.gz
body: 'macos app and dmg'
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: windows.tar.gz
tag: ${{ steps.get-latest-tag.outputs.tag }}
asset_name: windows-${{ github.sha }}.tar.gz
body: 'windows msi and exe'
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: linux.tar.gz
tag: ${{ steps.get-latest-tag.outputs.tag }}
asset_name: linux-${{ github.sha }}.tar.gz
body: 'linux deb and appimage'