-
Notifications
You must be signed in to change notification settings - Fork 81
51 lines (42 loc) · 1.25 KB
/
publish.yml
File metadata and controls
51 lines (42 loc) · 1.25 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
name: Publish Package
on:
push:
tags:
- 'v*'
permissions:
id-token: write
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- name: Update npm
run: npm install -g npm@latest
- run: pnpm install
- run: pnpm build
- run: pnpm run smoke:pack
- run: pnpm publish --no-git-checks --provenance --access public
- name: Detect previous tag
id: tags
run: |
previous_tag="$(git describe --tags --abbrev=0 "${GITHUB_REF_NAME}^" 2>/dev/null || true)"
echo "previous_tag=$previous_tag" >> "$GITHUB_OUTPUT"
- name: Create GitHub release with changelog
run: |
args=(--to "$GITHUB_REF_NAME")
if [ -n "${{ steps.tags.outputs.previous_tag }}" ]; then
args+=(--from "${{ steps.tags.outputs.previous_tag }}")
fi
npx --yes changelogithub@14.0.0 "${args[@]}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}