-
-
Notifications
You must be signed in to change notification settings - Fork 30
139 lines (129 loc) · 5.71 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
name: Release Artifacts
on:
push:
branches:
- main
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_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install webkit2gtk (ubuntu only)
if: matrix.NAME == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install app dependencies and build it
run: npm ci && npm run build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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-x64.dmg
asset_name: authme-${{steps.version.outputs.prop}}-macos-x64.dmg
asset_content_type: application/octet-stream
- name: Hash
run: cat ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-${{matrix.NAME}}-x64.sig
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: authme-latest-release-${{matrix.NAME}}-x64-installer-portable
path: core/target/release