-
Notifications
You must be signed in to change notification settings - Fork 13
109 lines (95 loc) · 3.48 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
name: Release
on:
release:
types: [created]
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
strategy:
fail-fast: false
matrix:
settings:
- platform: "macos-latest"
args: "--target aarch64-apple-darwin"
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-latest"
args: ""
- platform: "windows-latest"
args: ""
runs-on: ${{ matrix.settings.platform }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- name: install dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install OpenSSL (Windows only)
if: matrix.settings.platform == 'windows-latest'
run: |
choco install openssl --execution-timeout 7200
mkdir -p "C:\Program Files\OpenSSL\ca"
curl -o "C:\Program Files\OpenSSL\ca\cacert.pem" https://curl.se/ca/cacert.pem
copy "C:\Program Files\OpenSSL\bin\libcrypto-3-x64.dll" .\src-tauri
copy "C:\Program Files\OpenSSL\bin\libssl-3-x64.dll" .\src-tauri
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.settings.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: Install dependencies
run: npm install
- name: Set Windows Env Vars
if: matrix.settings.platform == 'windows-latest'
run: |
echo "OPENSSL_DIR='C:\Program Files\OpenSSL'" >> $env:GITHUB_ENV
echo "SSL_CERT_FILE='C:\Program Files\OpenSSL\ca\cacert.pem'" >> $env:GITHUB_ENV
echo "OPENSSL_NO_VENDOR=1" >> $env:GITHUB_ENV
- name: Fetch release notes
uses: actions/github-script@v7
id: release_notes
with:
result-encoding: string
script: |
const packageVersion = require('./package.json').version;
const { data: release } = await github.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: `v${packageVersion}`
});
return release.body;
- name: Create release
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "v__VERSION__"
releaseBody: "${{steps.release_notes.outputs.result}}"
releaseDraft: true
prerelease: false
tauriScript: ./node_modules/.bin/tauri
args: ${{ matrix.settings.args }}
publish_update_manifest:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Invoke JET Pilot Docs deployment
uses: benc-uk/workflow-dispatch@v1
with:
workflow: deploy.yml
repo: unxsist/jet-pilot-docs
token: "${{ secrets.SEMANTIC_RELEASE_PAT }}"