forked from ztombol/bats-assert
-
Notifications
You must be signed in to change notification settings - Fork 50
37 lines (35 loc) · 1.15 KB
/
release.yml
File metadata and controls
37 lines (35 loc) · 1.15 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
name: Release
on:
push: { tags: "v[0-9]+.[0-9]+.[0-9]+*" }
permissions: {}
jobs:
github:
permissions: { contents: write }
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with: { egress-policy: audit }
- uses: actions/checkout@v4
# TODO exit this job differently than success if release already exists
- name: gh release create
run: |
# shellcheck disable=SC2086
gh release view $tag || \
gh release create ${tag/*-*/"$tag" --prerelease} --generate-notes
env:
GH_TOKEN: ${{ github.token }}
tag: ${{ github.ref_name }}
npm:
permissions: { id-token: write }
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with: { egress-policy: audit }
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}