-
-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (78 loc) · 2.79 KB
/
release.yml
File metadata and controls
90 lines (78 loc) · 2.79 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
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release
on:
workflow_dispatch:
inputs:
channel:
description: 'NPM Release channel'
type: choice
required: false
options:
- preview
- latest
dry-run:
description: Should only preview operations instead of actually executing them
type: boolean
required: false
default: true
publish-only:
description: Should run only publish command
type: boolean
required: false
default: false
skip-publish:
description: Should run only version and changelog and skip publishing
type: boolean
required: false
default: false
github-release:
description: Should create Github release (doing so will require pushing changes)
type: boolean
required: false
default: true
env:
TERM: xterm-256color
FORCE_COLOR: 'true'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: 'true'
fetch-depth: '0'
- name: Enable Corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org/'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Install dependencies
run: yarn install --immutable
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Lint all packages
run: yarn lint
- name: Test all packages
run: yarn test
- name: Build all packages
run: yarn build
- name: Setup Git user
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
- name: Release packages on '${{ inputs.channel }}' channel ${{ inputs.dry-run && '(dry-run)' || ''}}
run: yarn release -c ${{ inputs.channel }} --verbose ${{ inputs.publish-only && '--publishOnly' || '' }} ${{ inputs.skip-publish && '--skipPublish' || '' }} ${{ inputs.github-release && '--githubRelease' || '' }} ${{ inputs.dry-run && '--dryRun' || '' }}
env:
RELEASE_ENABLED: ${{ vars.RELEASE_ENABLED }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true