-
Notifications
You must be signed in to change notification settings - Fork 2
148 lines (131 loc) · 7.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
148
name: 'publish'
# This will trigger the action on each push to the `release` branch.
on:
push:
branches:
- release
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
target: aarch64-apple-darwin
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
target: x86_64-apple-darwin
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: '--target x86_64-unknown-linux-gnu'
target: x86_64-unknown-linux-gnu
# - platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
# args: '--target aarch64-unknown-linux-gnu'
# target: aarch64-unknown-linux-gnu
- platform: 'windows-latest'
args: ''
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies
run: |
rustup target add ${{ matrix.target }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# - name: Create /etc/apt/sources.list
# if: matrix.target == 'aarch64-unknown-linux-gnu' # This must match the platform value defined above.
# run: |
# sudo tee /etc/apt/sources.list > /dev/null << 'EOF'
# # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# # newer versions of the distribution.
# deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted
# # deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted
# ## Major bug fix updates produced after the final release of the
# ## distribution.
# deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# # deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
# ## team. Also, please note that software in universe WILL NOT receive any
# ## review or updates from the Ubuntu security team.
# deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy universe
# # deb-src http://archive.ubuntu.com/ubuntu/ jammy universe
# deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates universe
# # deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates universe
# ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
# ## team, and may not be under a free licence. Please satisfy yourself as to
# ## your rights to use the software. Also, please note that software in
# ## multiverse WILL NOT receive any review or updates from the Ubuntu
# ## security team.
# deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy multiverse
# # deb-src http://archive.ubuntu.com/ubuntu/ jammy multiverse
# deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# ## N.B. software from this repository may not have been tested as
# ## extensively as that contained in the main release, although it includes
# ## newer versions of some applications which may provide useful features.
# ## Also, please note that software in backports WILL NOT receive any review
# ## or updates from the Ubuntu security team.
# deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# # deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security main restricted
# # deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted
# deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security universe
# # deb-src http://security.ubuntu.com/ubuntu/ jammy-security universe
# deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security multiverse
# # deb-src http://security.ubuntu.com/ubuntu/ jammy-security multiverse
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy universe
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates universe
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy multiverse
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates multiverse
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security universe
# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse
# EOF
# # webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# # You can remove the one that doesn't apply to your app to speed up the workflow a bit.
# - name: install dependencies (ubuntu arm64 only)
# if: matrix.target == 'aarch64-unknown-linux-gnu' # This must match the platform value defined above.
# run: |
# rustup target add aarch64-unknown-linux-gnu
# sudo apt-get update
# sudo apt-get install -y gcc-aarch64-linux-gnu
# sudo dpkg --add-architecture arm64
# sudo apt install libwebkit2gtk-4.0-dev:arm64
# sudo apt install libssl-dev:arm64
# export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/
- name: Install pnpm
run: npm install -g pnpm
- name: install frontend dependencies
run: pnpm install # change this to npm, pnpm or bun depending on which one you use.
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: __VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'Git Statistic v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
- name: Build Portable Binaries (Windows)
if: ${{ matrix.runner == 'windows-latest' }}
run: |
cargo build --release --target ${{ matrix.target }}
mv ./target/${{ matrix.target }}/release/git-statistic.exe ./target/${{ matrix.target }}/release/git-statistic_${{ github.ref_name }}_x64-portable.exe
- name: Upload Portable Binaries (Windows)
if: ${{ matrix.runner == 'windows-latest' }}
run: bash -c 'gh release upload ${{ github.ref_name }} ./target/${{ matrix.target }}/release/git-statistic_${{ github.ref_name }}_x64-portable.exe --clobber'