From 42aad1fe96213ffb427fa88b0fe4ffb69871a164 Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Sat, 13 Jan 2024 23:58:42 +0300 Subject: [PATCH] fix(ci): force/skip push to registries on manual release (#549) What it says on the tin can. Also fixes a typo in the `vscode-extension` job. #### Motivation and context Manual re-release breaks otherwise as seen [here](https://github.com/metatypedev/metatype/actions/runs/7508564194/job/20444227861). --- .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 }}