-
-
Notifications
You must be signed in to change notification settings - Fork 32
172 lines (151 loc) · 6.83 KB
/
release-artifacts.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
name: Release Artifacts
on:
push:
tags:
- "*"
jobs:
test-tauri:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
NAME: macos
- os: ubuntu-latest
NAME: linux
- os: windows-latest
NAME: windows
runs-on: ${{ matrix.os}}
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./core -> target"
- name: Install trusted-signing-cli
if: matrix.NAME == 'windows'
run: |
cargo install trusted-signing-cli@0.3.0
- name: "Apple silicon target"
if: runner.os == 'macOS'
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
- name: Install webkit2gtk (ubuntu only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install app dependencies and build it
if: runner.os == 'Linux' || runner.os == 'Windows'
run: npm ci && npm run build
- name: Install app dependencies and build it
if: runner.os == 'macOS'
run: npm ci && npm run build -- --target universal-apple-darwin
- name: Remove useless folders
run: |
rm -rf core/target/release/build
rm -rf core/target/release/deps
rm -rf core/target/release/bundle/appimage/authme.AppDir
npm run rename
shell: bash
- uses: octokit/request-action@v2.x
id: get_latest_release
with:
route: GET /repos/:repository/releases?per_page=1
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get upload url
id: get_upload_url
run: >
url=$(echo "$response" | jq -r ".[0].upload_url")
echo "::set-output name=url::$url"
env:
response: ${{ steps.get_latest_release.outputs.data }}
shell: bash
- name: Get version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: package.json
prop_path: version
# Windows
- name: Upload the windows installer asset
if: runner.os == 'Windows'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_upload_url.outputs.url}}
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-windows-x64.msi
asset_name: authme-${{steps.version.outputs.prop}}-windows-x64.msi
asset_content_type: application/octet-stream
- name: Upload the windows updater asset
if: runner.os == 'Windows'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_upload_url.outputs.url}}
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-windows-x64.zip
asset_name: authme-${{steps.version.outputs.prop}}-windows-x64.zip
asset_content_type: application/octet-stream
# Linux
- name: Upload the linux installer asset
if: runner.os == 'Linux'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_upload_url.outputs.url}}
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-linux-x64.appimage
asset_name: authme-${{steps.version.outputs.prop}}-linux-x64.appimage
asset_content_type: application/octet-stream
- name: Upload the linux installer asset
if: runner.os == 'Linux'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_upload_url.outputs.url}}
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-linux-x64.deb
asset_name: authme-${{steps.version.outputs.prop}}-linux-x64.deb
asset_content_type: application/octet-stream
# Mac
- name: Upload the mac installer asset
if: runner.os == 'macOS'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_upload_url.outputs.url}}
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-macos-universal.dmg
asset_name: authme-${{steps.version.outputs.prop}}-macos-universal.dmg
asset_content_type: application/octet-stream
- name: Hash
if: runner.os == 'Windows' || runner.os == 'Linux'
run: cat ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-${{matrix.NAME}}-x64.sig
shell: bash
- name: Hash
if: runner.os == 'macOS'
run: cat ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-${{matrix.NAME}}-universal.sig
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: authme-latest-release-${{matrix.NAME}}-x64-installer-portable
path: core/target/release