From c4aad5f0273cb2203be5d6280c755bfcea2545f5 Mon Sep 17 00:00:00 2001 From: Yannick Date: Tue, 31 Mar 2026 23:11:41 +0200 Subject: [PATCH 1/2] Combine the release scripts --- .github/workflows/prerelease.yml | 64 -------------------------------- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml deleted file mode 100644 index 8cc6fe32..00000000 --- a/.github/workflows/prerelease.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Prerelease - -on: - pull_request: - types: [closed] - branches: ["next"] - -permissions: - contents: write - id-token: write - -jobs: - prerelease: - name: Prerelease Amicons - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - name: Get version - id: version - run: echo "version=$(jq -r '.version' amicons/package.json)" >> $GITHUB_OUTPUT - - name: Set prerelease metadata - id: meta - run: | - echo "tag=v${{ steps.version.outputs.version }}-next.${{ github.run_number }}" >> $GITHUB_OUTPUT - echo "label=v${{ steps.version.outputs.version }}-next.${{ github.run_number }}" >> $GITHUB_OUTPUT - - name: Set up pnpm - uses: pnpm/action-setup@v5 - with: - version: 10.33.0 - - name: Set up Node 24 - uses: actions/setup-node@v6 - with: - node-version: 24.x - cache: "pnpm" - cache-dependency-path: amicons/pnpm-lock.yaml - registry-url: "https://registry.npmjs.org" - - name: Install dependencies - working-directory: amicons - run: pnpm install --frozen-lockfile - - name: Production build - working-directory: amicons - run: pnpm prod - - name: Package icons - working-directory: amicons - run: zip -r ../amicons-${{ steps.meta.outputs.label }}-icons.zip icons -i "*.svg" - - - name: Write release notes - env: - BODY: ${{ github.event.pull_request.body }} - run: echo "$BODY" > release-notes.md - - name: Create GitHub prerelease - run: | - gh release create ${{ steps.meta.outputs.tag }} \ - --title "${{ steps.meta.outputs.label }}" \ - --prerelease \ - --notes-file release-notes.md \ - "amicons-${{ steps.meta.outputs.label }}-icons.zip#Amicons icons ${{ steps.meta.outputs.label }}" - env: - GH_TOKEN: ${{ github.token }} - - name: Publish to npm (next) - working-directory: amicons - run: pnpm publish --no-git-checks --access public --provenance --tag next diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9fd5eb72..f6c85ac1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release on: pull_request: types: [closed] - branches: ["main"] + branches: ["main", "next"] permissions: contents: write @@ -12,7 +12,7 @@ permissions: jobs: release: name: Release Amicons - if: github.event.pull_request.merged == true + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' runs-on: ubuntu-latest steps: - name: Checkout @@ -47,7 +47,7 @@ jobs: - name: Create GitHub release run: | gh release create v${{ steps.version.outputs.version }} \ - --title "v${{ steps.version.outputs.version }}" \ + --title "${{ github.event.pull_request.title }}" \ --notes-file release-notes.md \ "amicons-${{ steps.version.outputs.version }}-icons.zip#Amicons icons v${{ steps.version.outputs.version }}" env: @@ -55,3 +55,56 @@ jobs: - name: Publish to npm working-directory: amicons run: pnpm publish --no-git-checks --access public --provenance + + prerelease: + name: Prerelease Amicons + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'next' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Get version + id: version + run: echo "version=$(jq -r '.version' amicons/package.json)" >> $GITHUB_OUTPUT + - name: Set prerelease metadata + id: meta + run: | + echo "tag=v${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT + echo "label=v${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT + - name: Set up pnpm + uses: pnpm/action-setup@v5 + with: + version: 10.33.0 + - name: Set up Node 24 + uses: actions/setup-node@v6 + with: + node-version: 24.x + cache: "pnpm" + cache-dependency-path: amicons/pnpm-lock.yaml + registry-url: "https://registry.npmjs.org" + - name: Install dependencies + working-directory: amicons + run: pnpm install --frozen-lockfile + - name: Production build + working-directory: amicons + run: pnpm prod + - name: Package icons + working-directory: amicons + run: zip -r ../amicons-${{ steps.meta.outputs.label }}-icons.zip icons -i "*.svg" + + - name: Write release notes + env: + BODY: ${{ github.event.pull_request.body }} + run: echo "$BODY" > release-notes.md + - name: Create GitHub prerelease + run: | + gh release create ${{ steps.meta.outputs.tag }} \ + --title "${{ github.event.pull_request.title }}" \ + --prerelease \ + --notes-file release-notes.md \ + "amicons-${{ steps.meta.outputs.label }}-icons.zip#Amicons icons ${{ steps.meta.outputs.label }}" + env: + GH_TOKEN: ${{ github.token }} + - name: Publish to npm (next) + working-directory: amicons + run: pnpm publish --no-git-checks --access public --provenance --tag next From 819ddb5b0213655ab789bb34eaa3d8e0f2b0ca2c Mon Sep 17 00:00:00 2001 From: Yannick Date: Tue, 31 Mar 2026 23:11:57 +0200 Subject: [PATCH 2/2] Bump version --- amicons/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amicons/package.json b/amicons/package.json index e4818a0f..d9df3be7 100644 --- a/amicons/package.json +++ b/amicons/package.json @@ -1,6 +1,6 @@ { "name": "@studio384/amicons", - "version": "1.0.0-dev.1", + "version": "1.0.0-dev.2", "description": "The iconography.", "keywords": [ "iconography",