Skip to content

Set up release workflow and NPM provenance #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup
description: Setup Node.js and install dependencies
inputs:
node-version:
description: Node version
required: false
default: '24'

runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4.1.0

- name: Setup Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4.4.0
with:
node-version: ${{ inputs.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install dependencies
run: pnpm install
shell: bash
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release & Publish to NPM & GitHub
on:
workflow_dispatch:
inputs:
increment:
description: 'Increment type: major, minor, patch, pre...'
required: true
type: choice
options:
- patch
- minor
- major
- prepatch
- preminor
- premajor
default: patch

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0

- name: Setup
uses: ./.github/actions/setup

- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6.3.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- run: pnpm run release --increment ${{github.event.inputs.increment}} --ci
env:
# For release-it
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
# For lerna-changelog
IGNORE_PEER_DEPENDENCIES: release-it
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

permissions:
contents: write
id-token: write
28 changes: 9 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [20, 22]
node: [22, 24]
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4.4.0
- name: Setup
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4.1.0
with:
run_install: true

- name: Test
run: pnpm test:coverage
Expand All @@ -40,11 +37,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Setup Node.js
uses: actions/setup-node@v4.4.0
- uses: pnpm/action-setup@v4.1.0
with:
run_install: true
- name: Setup
uses: ./.github/actions/setup

- name: Lint
run: pnpm lint
Expand All @@ -55,11 +49,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Setup Node.js
uses: actions/setup-node@v4.4.0
- uses: pnpm/action-setup@v4.1.0
with:
run_install: true
- name: Setup
uses: ./.github/actions/setup

- name: Build
run: pnpm build
Expand All @@ -77,9 +68,8 @@ jobs:
with:
repository: fluent-vue/examples
path: examples
- name: Setup Node.js
uses: actions/setup-node@v4.4.0
- uses: pnpm/action-setup@v4.1.0
- name: Setup
uses: ./.github/actions/setup

- name: Test
run: node scripts/build-examples.js
3 changes: 2 additions & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
},
"plugins": {
"@release-it-plugins/lerna-changelog": {
"infile": "CHANGELOG.md"
"infile": "CHANGELOG.md",
"launchEditor": false
}
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"typecheck": "tsc --noEmit",
"lint": "eslint .",
"prepare": "husky",
"release": "dotenv -- release-it"
"release": "release-it"
},
"peerDependencies": {
"@fluent/bundle": "*",
Expand Down Expand Up @@ -120,7 +120,6 @@
"@vitejs/plugin-vue": "5.2.4",
"@vitest/coverage-istanbul": "^3.1.4",
"@vue/compiler-sfc": "3.5.16",
"dotenv-cli": "8.0.0",
"eslint": "9.28.0",
"execa": "9.6.0",
"husky": "9.1.7",
Expand All @@ -137,7 +136,9 @@
},
"lint-staged": {
"*.js": "eslint --fix",
"*.ts?(x)": "eslint --fix"
"*.ts?(x)": "eslint --fix",
"*.json": "eslint --fix",
"*.md": "eslint --fix"
},
"changelog": {
"labels": {
Expand Down
Loading
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy