-
-
Notifications
You must be signed in to change notification settings - Fork 371
93 lines (86 loc) · 2.44 KB
/
Copy pathrelease.yml
File metadata and controls
93 lines (86 loc) · 2.44 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
91
92
93
name: Release
permissions: {}
on:
push:
tags: ['v6.[0-9]+.[0-9]+']
jobs:
build:
uses: ./.github/workflows/build.yml
npm:
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
- name: Load cached dist
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: dist
with:
path: dist
key: dist-${{ hashFiles('src/**/*.ts', 'tsconfig/*.json', '.github/workflows/*.yml', 'package-lock.json') }}
fail-on-cache-miss: true
- name: Prepare distribution
run: node tools/publish.cjs
- run: npm install -g npm@latest
- run: npm stage publish
jsr:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- run: npx jsr publish
cleanup:
needs:
- npm
- jsr
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- run: git push origin $GITHUB_SHA:v6.x
- run: git rm -r dist
- run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "chore: cleanup after release"
- run: git push origin HEAD:main
github:
needs:
- npm
- jsr
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 2
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: 'npm'
- run: node tools/release-notes.cjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}