Skip to content

Commit 9dc792b

Browse files
committed
Merge branch 'master' of github.com:UnityExtractor-rs/UnityExtrator
2 parents 9498e09 + 9a40fab commit 9dc792b

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: 'publish'
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
jobs:
9+
create-release:
10+
permissions:
11+
contents: write
12+
runs-on: ubuntu-20.04
13+
outputs:
14+
release_id: ${{ steps.create-release.outputs.result }}
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: setup node
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 16
22+
- name: get version
23+
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
24+
- name: create release
25+
id: create-release
26+
uses: actions/github-script@v6
27+
with:
28+
script: |
29+
const { data } = await github.rest.repos.createRelease({
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
tag_name: `app-v${process.env.PACKAGE_VERSION}`,
33+
name: `Desktop App v${process.env.PACKAGE_VERSION}`,
34+
body: 'Take a look at the assets to download and install this app.',
35+
draft: true,
36+
prerelease: false
37+
})
38+
return data.id
39+
40+
build-tauri:
41+
needs: create-release
42+
permissions:
43+
contents: write
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
platform: [macos-latest, ubuntu-20.04, windows-latest]
48+
49+
runs-on: ${{ matrix.platform }}
50+
steps:
51+
- uses: actions/checkout@v3
52+
- name: setup node
53+
uses: actions/setup-node@v3
54+
with:
55+
node-version: 18
56+
- name: install Rust stable
57+
uses: dtolnay/rust-toolchain@stable
58+
- name: install dependencies (ubuntu only)
59+
if: matrix.platform == 'ubuntu-20.04'
60+
run: |
61+
sudo apt-get update
62+
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
63+
- name: install frontend dependencies
64+
run: npm install # change this to npm or pnpm depending on which one you use
65+
- uses: tauri-apps/tauri-action@v0
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
with:
69+
releaseId: ${{ needs.create-release.outputs.release_id }}
70+
71+
publish-release:
72+
permissions:
73+
contents: write
74+
runs-on: ubuntu-20.04
75+
needs: [create-release, build-tauri]
76+
77+
steps:
78+
- name: publish release
79+
id: publish-release
80+
uses: actions/github-script@v6
81+
env:
82+
release_id: ${{ needs.create-release.outputs.release_id }}
83+
with:
84+
script: |
85+
github.rest.repos.updateRelease({
86+
owner: context.repo.owner,
87+
repo: context.repo.repo,
88+
release_id: process.env.release_id,
89+
draft: false,
90+
prerelease: false
91+
})

0 commit comments

Comments
 (0)