diff --git a/.github/workflows/release-ember-client.yml b/.github/workflows/release-ember-client.yml index b0d92eb2..5a980411 100644 --- a/.github/workflows/release-ember-client.yml +++ b/.github/workflows/release-ember-client.yml @@ -39,7 +39,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Upgrade npm for Trusted Publishers @@ -124,7 +124,7 @@ jobs: - name: Set Node.js back to release version uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Install dependencies @@ -219,7 +219,7 @@ jobs: } >> $GITHUB_OUTPUT - name: Create GitHub Release - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: tag_name: ${{ steps.version.outputs.tag }} name: ๐Ÿน Ember SDK v${{ steps.version.outputs.version }} diff --git a/.github/workflows/release-ruby-client.yml b/.github/workflows/release-ruby-client.yml index 6e0bfb1d..55e6632c 100644 --- a/.github/workflows/release-ruby-client.yml +++ b/.github/workflows/release-ruby-client.yml @@ -204,7 +204,7 @@ jobs: } >> $GITHUB_OUTPUT - name: Create GitHub Release - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: tag_name: ${{ steps.new_version.outputs.tag }} name: ๐Ÿ’Ž Ruby Client v${{ steps.new_version.outputs.version }} diff --git a/.github/workflows/release-static-site-client.yml b/.github/workflows/release-static-site-client.yml index 8b62cca7..d4febdf5 100644 --- a/.github/workflows/release-static-site-client.yml +++ b/.github/workflows/release-static-site-client.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Upgrade npm for Trusted Publishers @@ -115,7 +115,7 @@ jobs: - name: Set Node.js back to release version uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Install dependencies @@ -225,7 +225,7 @@ jobs: } >> $GITHUB_OUTPUT - name: Create GitHub Release - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: tag_name: ${{ steps.version.outputs.tag }} name: ๐Ÿ—๏ธ Static Site Plugin v${{ steps.version.outputs.version }} diff --git a/.github/workflows/release-storybook-client.yml b/.github/workflows/release-storybook-client.yml index e6024d4a..9cf55f7f 100644 --- a/.github/workflows/release-storybook-client.yml +++ b/.github/workflows/release-storybook-client.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Upgrade npm for Trusted Publishers @@ -115,7 +115,7 @@ jobs: - name: Set Node.js back to release version uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Install dependencies @@ -215,7 +215,7 @@ jobs: } >> $GITHUB_OUTPUT - name: Create GitHub Release - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: tag_name: ${{ steps.version.outputs.tag }} name: ๐Ÿ“š Storybook Plugin v${{ steps.version.outputs.version }} diff --git a/.github/workflows/release-swift-client.yml b/.github/workflows/release-swift-client.yml index c39952c6..df6d7c62 100644 --- a/.github/workflows/release-swift-client.yml +++ b/.github/workflows/release-swift-client.yml @@ -33,7 +33,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Upgrade npm for Trusted Publishers @@ -57,33 +57,26 @@ jobs: - name: Ensure we have latest main run: | - git fetch origin main + git fetch origin main --tags git reset --hard origin/main - - name: Get current version - id: current_version + - name: Prepare release version + id: new_version working-directory: ./clients/swift + env: + VERSION_TYPE: ${{ github.event.inputs.version_type }} run: | CURRENT_VERSION=$(node -p "require('./package.json').version") - echo "version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT" - - - name: Get previous release tag - id: previous_tag - run: | - PREV_TAG="" - if git rev-parse "swift/v${{ steps.current_version.outputs.version }}" >/dev/null 2>&1; then - PREV_TAG="swift/v${{ steps.current_version.outputs.version }}" + PREVIOUS_TAG="" + if git rev-parse "swift/v$CURRENT_VERSION" >/dev/null 2>&1; then + PREVIOUS_TAG="swift/v$CURRENT_VERSION" fi - echo "tag=$PREV_TAG" >> $GITHUB_OUTPUT + NEW_VERSION=$(npm version "$VERSION_TYPE" --no-git-tag-version | sed 's/^v//') - - name: Bump version - id: new_version - working-directory: ./clients/swift - run: | - NEW_VERSION=$(npm version ${{ github.event.inputs.version_type }} --no-git-tag-version | sed 's/v//') - echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT - echo "tag=swift/v$NEW_VERSION" >> $GITHUB_OUTPUT - echo "spm_tag=v$NEW_VERSION" >> $GITHUB_OUTPUT + echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" + echo "tag=swift/v$NEW_VERSION" >> "$GITHUB_OUTPUT" + echo "spm_tag=v$NEW_VERSION" >> "$GITHUB_OUTPUT" + echo "previous_tag=$PREVIOUS_TAG" >> "$GITHUB_OUTPUT" - name: Verify release tags are available run: | @@ -113,10 +106,10 @@ jobs: Context: - Client location: `clients/swift/` - - Previous tag: `${{ steps.previous_tag.outputs.tag }}` + - Previous tag: `${{ steps.new_version.outputs.previous_tag }}` - New version: `${{ steps.new_version.outputs.version }}` - This is a monorepo with multiple clients and a CLI. - - Compare URL when a previous tag exists: `https://github.com/vizzly-testing/cli/compare/${{ steps.previous_tag.outputs.tag }}...swift/v${{ steps.new_version.outputs.version }}` + - Compare URL when a previous tag exists: `https://github.com/vizzly-testing/cli/compare/${{ steps.new_version.outputs.previous_tag }}...swift/v${{ steps.new_version.outputs.version }}` - Release URL when this is the first Swift tag: `https://github.com/vizzly-testing/cli/releases/tag/swift/v${{ steps.new_version.outputs.version }}` Instructions: @@ -204,9 +197,16 @@ jobs: - name: Verify npm package version is unpublished working-directory: ./clients/swift + env: + RELEASE_VERSION: ${{ steps.new_version.outputs.version }} run: | - if npm view @vizzly-testing/swift@${{ steps.new_version.outputs.version }} version >/dev/null 2>&1; then - echo "@vizzly-testing/swift@${{ steps.new_version.outputs.version }} is already published" + if NPM_OUTPUT=$(npm view "@vizzly-testing/swift@$RELEASE_VERSION" version 2>&1); then + echo "@vizzly-testing/swift@$RELEASE_VERSION is already published" + exit 1 + elif printf '%s\n' "$NPM_OUTPUT" | grep -q 'E404'; then + : + else + printf '%s\n' "$NPM_OUTPUT" exit 1 fi @@ -254,7 +254,7 @@ jobs: } >> $GITHUB_OUTPUT - name: Create GitHub Release - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: tag_name: ${{ steps.new_version.outputs.tag }} name: ๐Ÿ“ฑ Swift SDK v${{ steps.new_version.outputs.version }} diff --git a/.github/workflows/release-vitest-client.yml b/.github/workflows/release-vitest-client.yml index c76aa7be..78f890a4 100644 --- a/.github/workflows/release-vitest-client.yml +++ b/.github/workflows/release-vitest-client.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Upgrade npm for Trusted Publishers @@ -115,7 +115,7 @@ jobs: - name: Set Node.js back to release version uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Install dependencies @@ -205,7 +205,7 @@ jobs: } >> $GITHUB_OUTPUT - name: Create GitHub Release - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: tag_name: ${{ steps.version.outputs.tag }} name: ๐Ÿงช Vitest Integration v${{ steps.version.outputs.version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3696845..c7a96128 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Upgrade npm for Trusted Publishers @@ -159,7 +159,7 @@ jobs: - name: Restore Node.js for publishing uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: - node-version: '22.13.1' + node-version: '22.14.0' registry-url: 'https://registry.npmjs.org' - name: Restore npm and pnpm for publishing @@ -194,7 +194,7 @@ jobs: git push origin "${{ steps.version.outputs.new_version }}" - name: Create GitHub Release - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: tag_name: ${{ steps.version.outputs.new_version }} name: ${{ github.event.inputs.version_type == 'beta' && '๐Ÿงช' || 'โœจ' }} ${{ steps.version.outputs.new_version }}