Skip to content

Commit f2fe49e

Browse files
committed
build: set release version
1 parent 2700766 commit f2fe49e

File tree

4 files changed

+5738
-146
lines changed

4 files changed

+5738
-146
lines changed

.github/workflows/release.yaml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
needs:
4141
- ci
4242

43-
semantic-release:
43+
create-release:
4444
runs-on: [ubuntu-20.04]
4545
needs:
4646
- ci
@@ -58,15 +58,34 @@ jobs:
5858
- name: install app dependencies
5959
run: npm install
6060

61+
- run: npx semantic-release --dry-run
62+
id: get-next-version
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
6166
- name: create release
6267
env:
6368
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6469
run: npx semantic-release
6570

71+
- name: get release ID
72+
id: get-release-id
73+
uses: actions/github-script@v7
74+
with:
75+
script: |
76+
const { data } = await github.rest.repos.getReleaseByTag({
77+
owner: context.repo.owner,
78+
repo: context.repo.repo,
79+
tag: ${{steps.get-next-version.outputs.new-release-version}}
80+
})
81+
return data.id
82+
outputs:
83+
release_id: ${{steps.get-release-id.outputs.result}}
84+
6685
package-tauri:
6786
if: false
6887
needs:
69-
- ci
88+
- create-release
7089
runs-on: ${{ matrix.platform }}
7190
strategy:
7291
matrix:
@@ -95,12 +114,13 @@ jobs:
95114
- name: install app dependencies
96115
run: npm install
97116

117+
- run: npx semantic-release --dry-run
118+
id: get-next-version
119+
env:
120+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
98122
- uses: tauri-apps/tauri-action@v0
99123
env:
100124
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101125
with:
102-
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
103-
releaseName: 'App v__VERSION__'
104-
releaseBody: 'See the assets to download this version and install.'
105-
releaseDraft: true
106-
prerelease: false
126+
releaseId: ${{ needs.create-release.outputs.release_id }}

commitlint.config.cjs

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)