-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.47 KB
/
release.yaml
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
---
name: Release
# yamllint disable rule:truthy
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
# yarn: latest / berry / stable
- run: |
corepack enable
yarn set version stable
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build:lib
- name: Read changelog
id: changelog
run: |
changelog=$(yarn changelog)
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$changelog" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Release
id: create_release
if: steps.changelog.outputs.changelog != ''
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
# body: the changelog
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Publish to NPM
if: steps.create_release.outputs.id
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish