From 5781950a899545638db1ba16aefa8e414ec6b13a Mon Sep 17 00:00:00 2001 From: Yannick Date: Mon, 30 Mar 2026 23:58:32 +0200 Subject: [PATCH 1/2] Add release scripts --- .github/workflows/prerelease.yml | 64 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 57 ++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 .github/workflows/prerelease.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 00000000..8cc6fe32 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,64 @@ +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 new file mode 100644 index 00000000..9fd5eb72 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: Release + +on: + pull_request: + types: [closed] + branches: ["main"] + +permissions: + contents: write + id-token: write + +jobs: + release: + name: Release 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 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 + - 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.version.outputs.version }}-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 release + run: | + gh release create v${{ steps.version.outputs.version }} \ + --title "v${{ steps.version.outputs.version }}" \ + --notes-file release-notes.md \ + "amicons-${{ steps.version.outputs.version }}-icons.zip#Amicons icons v${{ steps.version.outputs.version }}" + env: + GH_TOKEN: ${{ github.token }} + - name: Publish to npm + working-directory: amicons + run: pnpm publish --no-git-checks --access public --provenance From 472f58b9bc56bd7490a53196037d3ead913d65c1 Mon Sep 17 00:00:00 2001 From: Yannick Date: Tue, 31 Mar 2026 23:01:09 +0200 Subject: [PATCH 2/2] Test run for publishing --- amicons/package.json | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/amicons/package.json b/amicons/package.json index fd500acd..e4818a0f 100644 --- a/amicons/package.json +++ b/amicons/package.json @@ -1,14 +1,28 @@ { "name": "@studio384/amicons", - "version": "1.0.0-alpha.11", + "version": "1.0.0-dev.1", "description": "The iconography.", - "type": "module", - "packageManager": "pnpm@10.33.0", - "engines": { - "node": ">=24", - "npm": "use pnpm", - "pnpm": ">=10" + "keywords": [ + "iconography", + "icons", + "svg-icons" + ], + "homepage": "https://studio384.github.io/amicons", + "bugs": { + "url": "https://github.com/studio384/amicons/issues" }, + "license": "AGPL-3.0-or-later", + "author": "", + "repository": { + "type": "git", + "url": "git+https://github.com/studio384/amicons.git" + }, + "files": [ + "/icons", + "/dist" + ], + "type": "module", + "sideEffects": false, "main": "./dist/index.cjs", "module": "./dist/index.js", "types": "./dist/index.d.ts", @@ -31,28 +45,6 @@ "md": "node scripts/generate-markdown.js", "prod": "pnpm icons && pnpm pages && pnpm lib && pnpm build" }, - "repository": { - "type": "git", - "url": "git+https://github.com/studio384/amicons.git" - }, - "files": [ - "/icons", - "/dist" - ], - "keywords": [ - "icons", - "svg-icons", - "iconography" - ], - "author": "", - "license": "AGPL-3.0-or-later", - "bugs": { - "url": "https://github.com/studio384/amicons/issues" - }, - "homepage": "https://studio384.github.io/amicons", - "peerDependencies": { - "react": ">=16.x" - }, "devDependencies": { "@types/react": "^19.0.1", "nodemon": "3.1.14", @@ -65,6 +57,9 @@ "tsup": "^8.0.0", "typescript": "^6.0.2" }, + "peerDependencies": { + "react": ">=16.x" + }, "browserslist": { "production": [ "last 2 versions", @@ -72,5 +67,10 @@ "not ie <= 11" ] }, - "sideEffects": false + "engines": { + "node": ">=24", + "npm": "use pnpm", + "pnpm": ">=10" + }, + "packageManager": "pnpm@10.33.0" }