-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (54 loc) · 2.21 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
64
65
66
67
68
name: Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Setup git
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: Checkout to tag
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
fetch-depth: 0
- name: Parse version from tag
id: version
uses: release-kit/semver@v2
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Create a new build
run: |
yarn install --frozen-lockfile
yarn test
yarn build
- name: Set version from release
uses: reedyuk/[email protected]
with:
version: ${{ steps.version.outputs.full }}
- name: Create NPM config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish latest
if: ${{ steps.version.outputs.prerelease == '' }}
run: npm publish
- name: Force update remote latest release branch
if: ${{ steps.version.outputs.prerelease == '' }}
run: git push origin ${{ github.event.release.tag_name }}:refs/heads/release/latest -f
- name: Force update remote major release branch
if: ${{ steps.version.outputs.prerelease == '' }}
run: git push origin ${{ github.event.release.tag_name }}:refs/heads/release/${{ steps.version.outputs.major }} -f
- name: Publish RC
if: ${{ steps.version.outputs.prerelease != '' }}
run: npm publish --tag ${{ steps.version.outputs.prerelease }}
- name: Force update remote latest release branch
if: ${{ steps.version.outputs.prerelease != '' }}
run: git push origin ${{ github.event.release.tag_name }}:refs/heads/release/latest-${{ steps.version.outputs.prerelease }} -f
- name: Force update remote major release branch
if: ${{ steps.version.outputs.prerelease != '' }}
run: git push origin ${{ github.event.release.tag_name }}:refs/heads/release/${{ steps.version.outputs.major }}-${{ steps.version.outputs.prerelease }} -f