From 05067302a0bcd934f826aa0b71cc1555e4e91159 Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Tue, 26 Nov 2024 19:06:07 +0000 Subject: [PATCH 1/4] chore: please prettier --- version.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.config.json b/version.config.json index 9d14019..95b8225 100644 --- a/version.config.json +++ b/version.config.json @@ -12,4 +12,4 @@ "zutron-e2e" ], "prereleaseIdentifier": "next" -} \ No newline at end of file +} From 0d9dae2b92efe9a2dd2d6c12d8d6ada0542eb814 Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Tue, 26 Nov 2024 19:08:22 +0000 Subject: [PATCH 2/4] ci: disable `turbo-version` config file update --- .github/workflows/prerelease.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 20eee62..a6d34a4 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -54,11 +54,11 @@ jobs: run: pnpm install --frozen-lockfile - name: Build run: pnpm build - - name: Update Turbo Version config - uses: restackio/update-json-file-action@2.1 - with: - file: version.config.json - fields: '{"prereleaseIdentifier": "${{inputs.prereleaseIdentifier}}"}' + # - name: Update Turbo Version config + # uses: restackio/update-json-file-action@2.1 + # with: + # file: version.config.json + # fields: '{"prereleaseIdentifier": "${{inputs.prereleaseIdentifier}}"}' - name: Create Release and Tags shell: bash run: pnpm turbo-version -b ${{inputs.prereleaseVersion}} From b5581abdcb6e13429f15b3411c457f642970ab56 Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Tue, 26 Nov 2024 19:31:33 +0000 Subject: [PATCH 3/4] ci: add dry run option --- .github/workflows/prerelease.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index a6d34a4..ce435e8 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -21,6 +21,11 @@ on: description: 'Prerelease Identifier. Used for NPM tag and version string. Defaults to "next", e.g. "1.0.0-next.0".' required: true default: 'next' + dryRun: + description: 'Do not touch or write anything. Show the commands.' + required: true + default: false + type: boolean env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -64,12 +69,18 @@ jobs: run: pnpm turbo-version -b ${{inputs.prereleaseVersion}} - name: Publish to NPM shell: bash - run: pnpm publish -r --tag ${{inputs.prereleaseIdentifier}} + run: pnpm publish -r --tag ${{inputs.prereleaseIdentifier}} ${{inputs.dryRun && '--dry-run' || ''}} env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Log git changes + if: ${{inputs.dryRun}} + run: | + git diff ..origin/main + echo "DRY RUN: No changes were made." - name: Push Tags and Commits id: push-tags shell: bash + if: ${{!inputs.dryRun}} run: | git push --tags && git push echo "RELEASE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT From f763b962558b41b3bb588e7cdf4a8730d90430b0 Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Tue, 26 Nov 2024 19:39:42 +0000 Subject: [PATCH 4/4] ci: remove `npmTag` option, add `dryRun` --- .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 95e77d5..2831e01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,11 @@ on: - patch - minor - major - npmTag: - description: 'NPM tag. Defaults to "latest".' + dryRun: + description: 'Do not touch or write anything. Show the commands.' required: true - default: 'latest' + default: false + type: boolean env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -58,12 +59,18 @@ jobs: run: pnpm turbo-version -b ${{inputs.releaseVersion}} - name: Publish to NPM shell: bash - run: pnpm publish -r --tag ${{inputs.npmTag}} + run: pnpm publish -r --tag latest ${{inputs.dryRun && '--dry-run' || ''}} env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Log git changes + if: ${{inputs.dryRun}} + run: | + git diff ..origin/main + echo "DRY RUN: No changes were made." - name: Push Tags and Commits id: push-tags shell: bash + if: ${{!inputs.dryRun}} run: | git push --tags && git push echo "RELEASE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT