forked from actions-rs/clippy-check
-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (53 loc) · 1.58 KB
/
release.yml
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
name: Release
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
concurrency:
group: "${{ github.workflow }}"
cancel-in-progress: true # only last step is important, which runs or doesn't
on:
workflow_dispatch: # releasing is manual as we don't want to release every time
permissions:
contents: write # to write tags
packages: write # to write tags to Docker registry
issues: write
pull-requests: write
id-token: write # to enable use of OIDC for npm provenance
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Only on main
if: github.ref != 'refs/heads/main'
shell: bash
run: |
echo "Only to be executed on main"
exit 1
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: false
- name: Setup Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Install dependencies
shell: bash
run: |
npm ci --ignore-scripts
- name: Build
shell: bash
run: |
npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_TO_TRIGGER_SUBSEQUENT_WORKFLOWS }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
npm run release