From 364eed141c368ddf5c441345507e4daab82e48cb Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Sat, 13 Jan 2024 00:34:50 +0000 Subject: [PATCH] fix(ci): force/skip push to registries on manual release --- .github/workflows/release.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c33830133c..19095c5e95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ on: workflow_dispatch: inputs: ovewriteArtifacts: - description: Ovewrite artifacts on the release. + description: Ovewrite artifacts on the release. Some will only be skipped. required: true type: boolean default: true @@ -160,7 +160,9 @@ jobs: cd typegraph/python poetry install poetry build - poetry publish + [ $${{ github.event_name == 'workflow_dispatch' && inputs.ovewriteArtifacts }} == 'true' ] \ + && poetry publish --skip-existing \ + || poetry publish cd ../.. npm install --global @bytecodealliance/jco@$JCO_VERSION @@ -174,7 +176,9 @@ jobs: cd typegraph/node/sdk/dist pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" - pnpm publish --no-git-checks + [ $${{ github.event_name == 'workflow_dispatch' && inputs.ovewriteArtifacts }} == 'true' ] \ + && pnpm publish --no-git-checks --force \ + || pnpm publish --no-git-checks - uses: svenstaro/upload-release-action@v2 with: tag: ${{ steps.latest-tag.outputs.tag }} @@ -284,7 +288,10 @@ jobs: pnpm compile:ts-server pnpm compile:vscode pnpm vscode:package - pnpm run publish -p $${ env.AZURE_DEVOPS_TOKEN } + + [ $${{ github.event_name == 'workflow_dispatch' && inputs.ovewriteArtifacts }} == 'true' ] \ + && pnpm run vscode:publish -p $${ env.AZURE_DEVOPS_TOKEN } --skip-duplicate \ + || pnpm run vscode:publish -p $${ env.AZURE_DEVOPS_TOKEN } - uses: svenstaro/upload-release-action@v2 with: tag: ${{ steps.latest-tag.outputs.tag }}