Skip to content

Commit 548616e

Browse files
committed
Update publish
1 parent 8db765e commit 548616e

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v*'
77

88
permissions:
9-
contents: read
9+
contents: write
1010
packages: write
1111

1212
jobs:
@@ -15,12 +15,12 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919

2020
- name: Setup Node.js
21-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@v6
2222
with:
23-
node-version: '22'
23+
node-version: 22
2424
registry-url: 'https://npm.pkg.github.com'
2525
cache: 'npm'
2626

@@ -51,3 +51,18 @@ jobs:
5151
env:
5252
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5353

54+
- name: Create release archive
55+
run: |
56+
STAGE="pigna-component-library-${{ steps.version.outputs.VERSION }}"
57+
mkdir "$STAGE"
58+
cp -r dist "$STAGE/dist"
59+
cp package.json "$STAGE/package.json"
60+
cp README.md "$STAGE/README.md"
61+
cp LICENSE "$STAGE/LICENSE"
62+
zip -r "$STAGE.zip" "$STAGE"
63+
64+
- name: Create GitHub Release
65+
run: gh release create "${{ github.ref_name }}" pigna-component-library-${{ steps.version.outputs.VERSION }}.zip --title "v${{ steps.version.outputs.VERSION }}" --generate-notes
66+
env:
67+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@ Runs automatically on every **push to `main`** and on **pull requests** targetin
154154

155155
### Publishing (`.github/workflows/publish.yml`)
156156

157-
Runs when you push a **version tag** (e.g. `v0.2.0`). The version in `package.json` is set automatically from the tag name — no need to update it manually. The package is published to **GitHub Packages**.
157+
Runs when you push a **version tag** (e.g. `v0.2.0`). The version in `package.json` is set automatically from the tag name — no need to update it manually. The workflow will:
158+
159+
1. Lint, test, and build the library
160+
2. Publish the package to **GitHub Packages**
161+
3. Create a **GitHub Release** with a consumer-ready ZIP (`pigna-component-library-<version>.zip`) containing `dist/`, `package.json`, `README.md`, and `LICENSE`
162+
163+
> **Note:** The repo `README.md` is for contributors. The consumer-facing readme lives in `PACKAGE.md` and is copied into the npm package and release ZIP at publish time.
158164
159165
To publish a new version:
160166

0 commit comments

Comments
 (0)