From 49f5eeb7084132985888c9c3e06711efd762a554 Mon Sep 17 00:00:00 2001 From: Berrie Nachtweh Date: Thu, 15 Jan 2026 18:52:24 +0100 Subject: [PATCH 1/3] ci(release): trigger new create release workflow and bump version --- .github/workflows/commitlint.yml | 13 +---- .github/workflows/create-release.yml | 30 +++------- .github/workflows/release.yml | 85 ---------------------------- 3 files changed, 10 insertions(+), 118 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index c5b6887..f30f637 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -16,17 +16,8 @@ jobs: with: fetch-depth: 0 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "pnpm" - - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup + uses: ./.github/actions/setup - name: Validate commit message run: pnpm exec commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.sha }} --verbose diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 722abe9..c95433a 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -1,4 +1,4 @@ -name: Create release PR +name: Create release on: workflow_dispatch: @@ -39,29 +39,15 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 + - name: Setup + uses: ./.github/actions/setup + + # install bumpp to calculate the new version + - name: Install bumpp + run: pnpm add -g bumpp - name: Calculate new version id: version run: | - # Read current version from manifest - CURRENT_VERSION=$(jq -r '."."' .release-please-manifest.json) - echo "Current version: $CURRENT_VERSION" - - # Install semver for version calculation - npm install -g semver - - # Calculate new version based on input - NEW_VERSION=$(semver -i ${{ inputs.version }} $CURRENT_VERSION) - echo "New version: $NEW_VERSION" + NEW_VERSION=$(bumpp -n ${{ inputs.version }} --preid ${{ inputs.preid }} --dry-run | grep 'New version:' | awk '{print $3}') echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT - - - name: Create release commit - run: | - git config user.name "ambitiondev-release-bot[bot]" - git config user.email "ambitiondev-release-bot[bot]@users.noreply.github.com" - git commit --allow-empty -m "chore: release ${{ steps.version.outputs.new_version }}" -m "Release-As: ${{ steps.version.outputs.new_version }}" - git push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d42c547..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -jobs: - # STAGE 1: Detect Release - detect: - name: Detect Release - runs-on: ubuntu-latest - outputs: - release_created: ${{ steps.release.outputs.release_created }} - tag_name: ${{ steps.release.outputs.tag_name }} - body: ${{ steps.release.outputs.body }} - steps: - - name: Generate Token - uses: actions/create-github-app-token@v1 - id: app-token - with: - app-id: ${{ secrets.BOT_APP_ID }} - private-key: ${{ secrets.BOT_PRIVATE_KEY }} - - - name: Checkout - uses: actions/checkout@v4 - with: - token: ${{ steps.app-token.outputs.token }} - fetch-depth: 0 - - - name: Release Please - id: release - uses: googleapis/release-please-action@v4 - with: - token: ${{ steps.app-token.outputs.token }} - - # STAGE 2: Build & Publish - publish: - name: Build & Publish - needs: detect - if: ${{ needs.detect.outputs.release_created }} - runs-on: ubuntu-latest - environment: npm-publish - permissions: - id-token: write - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ needs.detect.outputs.tag_name }} - - - name: Build - uses: ./.github/actions/build - - - name: Publish to NPM - run: | - pnpm config set //registry.npmjs.org/:_authToken "" - pnpm publish --no-git-checks --provenance --access public - - - name: Determine if Prerelease - id: prerelease - run: | - if [[ "${{ needs.detect.outputs.tag_name }}" =~ -.*$ ]]; then - echo "is_prerelease=true" >> $GITHUB_OUTPUT - else - echo "is_prerelease=false" >> $GITHUB_OUTPUT - fi - - - name: Create GitHub Release - shell: bash - run: | - echo "${{ needs.detect.outputs.body }}" > release_notes.md - - PRERELEASE_FLAG="" - if [ "${{ steps.prerelease.outputs.is_prerelease }}" = "true" ]; then - PRERELEASE_FLAG="--prerelease" - fi - - gh release create ${{ needs.detect.outputs.tag_name }} \ - --title "${{ needs.detect.outputs.tag_name }}" \ - --notes-file release_notes.md \ - $PRERELEASE_FLAG - env: - GH_TOKEN: ${{ github.token }} From 96bfb205c73d3e1f1686d08511f334946f9d7122 Mon Sep 17 00:00:00 2001 From: Berrie Nachtweh Date: Thu, 15 Jan 2026 19:15:06 +0100 Subject: [PATCH 2/3] chore: release v0.0.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8238716..5fdb482 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ambitiondev/dynamic-url", "description": "lightweight util for creating dynamic endpoint strings", - "version": "0.0.2", + "version": "0.0.3", "main": "./dist/src/url.js", "types": "./dist/src/url.d.ts", "files": [ From e9add5df06af151581cef6b4032a3e3785f95467 Mon Sep 17 00:00:00 2001 From: Berrie Nachtweh Date: Thu, 15 Jan 2026 20:03:29 +0100 Subject: [PATCH 3/3] ci(release): test changelogen --- .../{create-release.yml => release.yml} | 25 ++++++++----------- package.json | 2 +- 2 files changed, 11 insertions(+), 16 deletions(-) rename .github/workflows/{create-release.yml => release.yml} (53%) diff --git a/.github/workflows/create-release.yml b/.github/workflows/release.yml similarity index 53% rename from .github/workflows/create-release.yml rename to .github/workflows/release.yml index c95433a..7db14ad 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/release.yml @@ -22,15 +22,6 @@ on: options: - latest - next - preid: - type: choice - description: Which prerelease identifier should be used? This is only needed when version is "prepatch", "preminor", "premajor", or "prerelease". - options: - - "" - - alpha - - beta - - rc - - next jobs: create-release: @@ -39,15 +30,19 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Configure Git Identity + run: | + git config user.name "ambitiondev-release-bot[bot]" + git config user.email "ambitiondev-release-bot[bot]@users.noreply.github.com" + - name: Setup uses: ./.github/actions/setup - # install bumpp to calculate the new version - - name: Install bumpp - run: pnpm add -g bumpp + - name: Install changelogen + run: pnpm add -g changelogen - - name: Calculate new version + - name: Create new version id: version run: | - NEW_VERSION=$(bumpp -n ${{ inputs.version }} --preid ${{ inputs.preid }} --dry-run | grep 'New version:' | awk '{print $3}') - echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + pnpm config set //registry.npmjs.org/:_authToken "" + pnpm dlx changelogen --bump --release --${{ github.event.inputs.version }} --publishTag ${{ github.event.inputs.tag }} --push --publish diff --git a/package.json b/package.json index 5fdb482..8238716 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ambitiondev/dynamic-url", "description": "lightweight util for creating dynamic endpoint strings", - "version": "0.0.3", + "version": "0.0.2", "main": "./dist/src/url.js", "types": "./dist/src/url.d.ts", "files": [