Skip to content

Commit 8c3780c

Browse files
authored
Merge pull request #43 from code-forge-io/feat/changesets-oidc-release
ci: changesets + OIDC trusted publishing; release 3.1.0 (minor)
2 parents b3e95d1 + aad1b5b commit 8c3780c

7 files changed

Lines changed: 1384 additions & 26 deletions

File tree

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": ["remix-vite", "remix-vite-cjs"]
11+
}

.changeset/spritesheet-3-1-0.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vite-plugin-icons-spritesheet": minor
3+
---
4+
5+
Add `oxfmt` as a formatter option and sort SVG files in a case-insensitive manner (#40, #42)

.github/workflows/publish.yaml

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,59 @@
1-
name: Publish Package to npmjs
1+
name: Release
2+
23
on:
3-
release:
4-
types: [published]
4+
push:
5+
branches:
6+
- main
7+
# Manual safety valve: re-run publish for a version that was bumped but never
8+
# published. Guarded below so a dispatch can only ever publish from main.
9+
workflow_dispatch:
10+
11+
concurrency:
12+
# Never cancel an in-progress release; queue concurrent runs instead.
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: false
15+
16+
permissions:
17+
contents: write # push the version PR branch, create tags + GitHub releases
18+
pull-requests: write # open/update the changesets "Release PR"
19+
id-token: write # npm Trusted Publishing (OIDC) — no long-lived NPM_TOKEN needed
20+
521
jobs:
6-
npm-publish:
22+
release:
23+
name: Release
24+
# Don't run on forks; only ever publish from main (incl. workflow_dispatch).
25+
if: github.repository_owner == 'code-forge-io' && github.ref == 'refs/heads/main'
726
runs-on: ubuntu-latest
827
steps:
9-
- uses: actions/checkout@v4
10-
# Setup .npmrc file to publish to npm
11-
- uses: actions/setup-node@v4
28+
- name: Checkout Repo
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1230
with:
13-
node-version: "20.x"
31+
fetch-depth: 0
32+
# Required so changesets/action can push the version PR branch. Only the
33+
# ephemeral GITHUB_TOKEN is persisted (auto-expires at job end) — no PAT.
34+
persist-credentials: true
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
38+
with:
39+
# Pin to Node 24 (ships npm 11.x); npm OIDC Trusted Publishing needs >= 11.5.1.
40+
node-version: "24"
1441
registry-url: "https://registry.npmjs.org"
15-
- run: npm ci
16-
- run: npm publish
42+
43+
- name: Install Dependencies
44+
run: npm ci
45+
46+
- name: Create Release Pull Request or Publish to npm
47+
id: changesets
48+
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
1749
env:
18-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
# Only used to open/update the Release PR and create GitHub releases.
51+
# npm authentication is handled by OIDC Trusted Publishing (.npmrc
52+
# provenance=true + id-token:write) — there is intentionally no NPM_TOKEN.
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
title: "🚀 Release PR"
56+
commit: "chore: release"
57+
version: npm run changeset:version
58+
publish: npm run changeset:publish
59+
createGithubReleases: true

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
provenance=true

0 commit comments

Comments
 (0)