Skip to content

Commit f1a4fdf

Browse files
committed
ci: publish release via github api
1 parent 36923f6 commit f1a4fdf

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,25 @@ jobs:
2626
2727
- name: Create GitHub release
2828
if: steps.release.outputs.exists == 'false'
29-
env:
30-
GH_TOKEN: ${{ github.token }}
31-
run: |
32-
gh release create v1.5.0 \
33-
--verify-tag \
34-
--title "uMesh v1.5.0" \
35-
--notes "Verified release of uMesh v1.5.0. Changes are limited to the locally verified implementation, CI, and release-prep work in this repository." \
36-
|| gh release view v1.5.0 >/dev/null 2>&1
29+
uses: actions/github-script@v7
30+
with:
31+
script: |
32+
const tag = 'v1.5.0';
33+
const { owner, repo } = context.repo;
34+
try {
35+
await github.rest.repos.getReleaseByTag({ owner, repo, tag });
36+
core.info(`Release ${tag} already exists.`);
37+
} catch (error) {
38+
if (error.status !== 404) {
39+
throw error;
40+
}
41+
await github.rest.repos.createRelease({
42+
owner,
43+
repo,
44+
tag_name: tag,
45+
name: 'uMesh v1.5.0',
46+
body: 'Verified release of uMesh v1.5.0. Changes are limited to the locally verified implementation, CI, and release-prep work in this repository.',
47+
draft: false,
48+
prerelease: false,
49+
});
50+
}

0 commit comments

Comments
 (0)