From 283dd59606806ff198f0d19c67057b7df8a60df1 Mon Sep 17 00:00:00 2001 From: Andrew Ghostuhin Date: Wed, 30 Sep 2026 00:26:04 +0300 Subject: [PATCH] fix(github): recover versioned workspace packages --- .github/workflows/publish-npm.yaml | 35 +++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-npm.yaml b/.github/workflows/publish-npm.yaml index c6ad650..312a459 100644 --- a/.github/workflows/publish-npm.yaml +++ b/.github/workflows/publish-npm.yaml @@ -9,6 +9,18 @@ on: paths-ignore: - '.github/**' workflow_dispatch: + inputs: + package: + description: Already versioned workspace from the failed release batch + required: true + type: choice + options: + - '@atls/react-app-links' + - '@atls/react-identity-links' + - '@atls/react-identity-user-provider' + - '@atls/react-kratos' + - '@atls/react-kratos-browser-flows' + - '@atls/tinkoff-payment-widget' jobs: publish: @@ -21,11 +33,13 @@ jobs: appPrivateKey: ${{ secrets.ATLANTIS_SUPER_BOT_PRIVATE_KEY }} npmAuthToken: ${{ secrets.NPM_TOKEN }} - publish-react-kratos-existing-version: + publish-existing-version: if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: read + env: + TARGET_PACKAGE: ${{ inputs.package }} steps: - name: Checkout versioned source uses: actions/checkout@v7 @@ -39,16 +53,27 @@ jobs: - name: Verify exact unpublished version run: | + set -euo pipefail test "$(git rev-parse HEAD)" = '9bc23729472414c56d1a0a2d67f423dec0f05cfc' - test "$(node -p "require('./packages/react-kratos/package.json').version")" = '0.1.0' - npm view @atls/react-kratos versions --json --registry=https://registry.npmjs.org | - node -e 'const fs = require("node:fs"); const versions = JSON.parse(fs.readFileSync(0, "utf8")); if ([versions].flat().includes("0.1.0")) { console.error("@atls/react-kratos@0.1.0 already exists in npm"); process.exit(1) }' + case "$TARGET_PACKAGE" in + '@atls/react-app-links') package_path='packages/app-links'; expected_version='0.1.0' ;; + '@atls/react-identity-links') package_path='packages/identity-links'; expected_version='0.1.0' ;; + '@atls/react-identity-user-provider') package_path='packages/identity-user-provider'; expected_version='0.1.0' ;; + '@atls/react-kratos') package_path='packages/react-kratos'; expected_version='0.1.0' ;; + '@atls/react-kratos-browser-flows') package_path='packages/kratos-browser-flows'; expected_version='0.1.0' ;; + '@atls/tinkoff-payment-widget') package_path='packages/payment-widget'; expected_version='0.2.0' ;; + *) exit 1 ;; + esac + test "$(node -p "require('./$package_path/package.json').name")" = "$TARGET_PACKAGE" + test "$(node -p "require('./$package_path/package.json').version")" = "$expected_version" + npm view "$TARGET_PACKAGE" versions --json --registry=https://registry.npmjs.org | + TARGET_VERSION="$expected_version" node -e 'const fs = require("node:fs"); const versions = JSON.parse(fs.readFileSync(0, "utf8")); if ([versions].flat().includes(process.env.TARGET_VERSION)) { console.error("Package version already exists in npm"); process.exit(1) }' - name: Install run: yarn install --immutable - name: Publish existing version to npm - run: yarn workspace @atls/react-kratos npm publish --access public + run: yarn workspace "$TARGET_PACKAGE" npm publish --access public env: YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} YARN_NPM_REGISTRY_SERVER: https://registry.npmjs.org