mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
ci: upsert release — reuse existing release if tag already exists
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,16 +29,27 @@ jobs:
|
|||||||
PACKAGE_VERSION: ${{ steps.get-version.outputs.version }}
|
PACKAGE_VERSION: ${{ steps.get-version.outputs.version }}
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
const tag = `app-v${process.env.PACKAGE_VERSION}`;
|
||||||
|
try {
|
||||||
|
const { data } = await github.rest.repos.getReleaseByTag({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
tag,
|
||||||
|
});
|
||||||
|
return data.id;
|
||||||
|
} catch (e) {
|
||||||
|
if (e.status !== 404) throw e;
|
||||||
|
}
|
||||||
const { data } = await github.rest.repos.createRelease({
|
const { data } = await github.rest.repos.createRelease({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
tag_name: `app-v${process.env.PACKAGE_VERSION}`,
|
tag_name: tag,
|
||||||
name: `Psysonic v${process.env.PACKAGE_VERSION}`,
|
name: `Psysonic v${process.env.PACKAGE_VERSION}`,
|
||||||
body: 'See the assets to download this version and install.',
|
body: 'See the assets to download this version and install.',
|
||||||
draft: false,
|
draft: false,
|
||||||
prerelease: false
|
prerelease: false
|
||||||
})
|
});
|
||||||
return data.id
|
return data.id;
|
||||||
|
|
||||||
build-macos-windows:
|
build-macos-windows:
|
||||||
needs: create-release
|
needs: create-release
|
||||||
|
|||||||
Reference in New Issue
Block a user