-
Notifications
You must be signed in to change notification settings - Fork 133
77 lines (65 loc) 路 2.02 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (65 loc) 路 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release to npm
run-name: Release v${{ inputs.version }} to npm (${{ inputs.npm_tag }})
on:
workflow_dispatch:
inputs:
version:
description: Version already set in package.json (for example, 3.0.5)
required: true
type: string
npm_tag:
description: npm distribution tag
required: true
default: latest
type: choice
options:
- latest
- next
# Before the first run, configure @react-three/postprocessing's npm trusted
# publisher for pmndrs/react-postprocessing, release.yml, and the npm environment.
# GitHub's short-lived OIDC token then replaces a long-lived NPM_TOKEN secret.
permissions:
contents: read
id-token: write
concurrency:
group: npm-release
cancel-in-progress: false
jobs:
publish:
name: Publish from master
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
timeout-minutes: 20
environment:
name: npm
url: https://www.npmjs.com/package/@react-three/postprocessing
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Verify release version
env:
EXPECTED_VERSION: ${{ inputs.version }}
run: |
ACTUAL_VERSION="$(node --print "require('./package.json').version")"
if [ "$ACTUAL_VERSION" != "$EXPECTED_VERSION" ]; then
echo "::error::package.json contains version $ACTUAL_VERSION, not $EXPECTED_VERSION"
exit 1
fi
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn eslint:ci
- name: Test
run: yarn test
- name: Build
run: yarn build
- name: Publish package
env:
NPM_TAG: ${{ inputs.npm_tag }}
run: npm publish --access public --tag "$NPM_TAG"