-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (66 loc) · 2.39 KB
/
release-please.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
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
release-type: node
package-name: DCR
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
get-release:
needs: release-please
if: ${{ needs.release-please.outputs.releases_created }}
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.get-last-release.outputs.result }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: get version
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
- id: get-last-release
name: Get last release
uses: actions/github-script@v6
with:
script: |
const { data } = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: `v${process.env.PACKAGE_VERSION}`
})
return data.id
build-tauri:
needs: get-release
strategy:
fail-fast: false
matrix:
platform: [macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: use correct bundle version (mac)
if: matrix.platform == 'macos-latest'
run: jq -r '.version' package.json > version.txt && jq --arg version "$(cat version.txt)" '.package.version = $version' src-tauri/tauri.conf.json > tmp && mv tmp src-tauri/tauri.conf.json
- name: use correct bundle version (windows)
if: matrix.platform == 'windows-latest'
run: jq -r '.version' package.json > version.txt && jq --arg version "$(type version.txt)" '.package.version = $version' src-tauri/tauri.conf.json > tmp && mv -Force tmp src-tauri/tauri.conf.json
- name: install app dependencies and build it
run: yarn && yarn tauri build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.get-release.outputs.release_id }}