Skip to content

Commit 036ffd0

Browse files
authored
Set up release workflow and NPM provenance (#945)
1 parent 5d9e996 commit 036ffd0

File tree

4 files changed

+76
-24
lines changed

4 files changed

+76
-24
lines changed

.github/actions/setup/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
inputs:
4+
node-version:
5+
description: Node version
6+
required: false
7+
default: '24'
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Install pnpm
13+
uses: pnpm/action-setup@v4.1.0
14+
15+
- name: Setup Node.js ${{ inputs.node-version }}
16+
uses: actions/setup-node@v4.4.0
17+
with:
18+
node-version: ${{ inputs.node-version }}
19+
cache: pnpm
20+
21+
- name: Install dependencies
22+
run: pnpm install
23+
shell: bash

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release & Publish to NPM & GitHub
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
increment:
6+
description: 'Increment type: major, minor, patch, pre...'
7+
required: true
8+
type: choice
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
- prepatch
14+
- preminor
15+
- premajor
16+
default: patch
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4.2.2
24+
- name: Setup
25+
uses: ./.github/actions/setup
26+
27+
- name: git config
28+
run: |
29+
git config user.name github-actions[bot]
30+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
31+
- run: pnpm run release -- --increment ${{github.event.inputs.increment}} --ci --dry-run
32+
env:
33+
# For release-it
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
NPM_CONFIG_PROVENANCE: true
37+
# For lerna-changelog
38+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/size.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4.2.2
18-
- name: Setup Node.js
19-
uses: actions/setup-node@v4.4.0
20-
- uses: pnpm/action-setup@v4.1.0
18+
- name: Setup
19+
uses: ./.github/actions/setup
2120

22-
- uses: antfu/export-size-action@v1
21+
- name: Check size changes
22+
uses: antfu/export-size-action@v1
2323
with:
2424
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,15 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ubuntu-latest, windows-latest]
19-
node: [20, 22]
19+
node: [22, 24]
2020
vue: [2, 3]
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v4.2.2
24-
- name: Setup Node.js ${{ matrix.node }}
25-
uses: actions/setup-node@v4.4.0
24+
- name: Setup
25+
uses: ./.github/actions/setup
2626
with:
2727
node-version: ${{ matrix.node }}
28-
- uses: pnpm/action-setup@v4.1.0
29-
with:
30-
run_install: true
3128

3229
- name: Test
3330
run: pnpm test:${{ matrix.vue }} --coverage
@@ -44,11 +41,8 @@ jobs:
4441
steps:
4542
- name: Checkout
4643
uses: actions/checkout@v4.2.2
47-
- name: Setup Node.js
48-
uses: actions/setup-node@v4.4.0
49-
- uses: pnpm/action-setup@v4.1.0
50-
with:
51-
run_install: true
44+
- name: Setup
45+
uses: ./.github/actions/setup
5246

5347
- name: Lint
5448
run: pnpm lint
@@ -61,11 +55,8 @@ jobs:
6155
steps:
6256
- name: Checkout
6357
uses: actions/checkout@v4.2.2
64-
- name: Setup Node.js
65-
uses: actions/setup-node@v4.4.0
66-
- uses: pnpm/action-setup@v4.1.0
67-
with:
68-
run_install: true
58+
- name: Setup
59+
uses: ./.github/actions/setup
6960

7061
- name: Build
7162
run: pnpm build
@@ -76,16 +67,16 @@ jobs:
7667
runs-on: ubuntu-latest
7768
name: Test build of example projects
7869
steps:
79-
- name: Checkout fluent-vue
70+
- name: Checkout
8071
uses: actions/checkout@v4.2.2
72+
- name: Setup
73+
uses: ./.github/actions/setup
74+
8175
- name: Checkout examples
8276
uses: actions/checkout@v4.2.2
8377
with:
8478
repository: fluent-vue/examples
8579
path: examples
86-
- name: Setup Node.js
87-
uses: actions/setup-node@v4.4.0
88-
- uses: pnpm/action-setup@v4.1.0
8980

9081
- name: Test
9182
run: node scripts/build-examples.mjs

0 commit comments

Comments
 (0)
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