-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (42 loc) · 1.41 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
name: Release
on:
pull_request:
types: [closed]
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release-v') }}
env:
CHANGELOG: ${{ github.event.pull_request.body }}
GH_TOKEN: ${{ github.token }}
REF_BRANCH: ${{ github.event.pull_request.head.ref }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: yarn install --pure-lockfile
- name: Typecheck
run: yarn typecheck
- name: Lint
run: yarn lint
- name: Run tests
run: yarn test
- name: Check licenses
run: yarn license-check
- name: Pack
run: yarn build
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
yarn workspace @swan-io/lake publish
yarn workspace @swan-io/shared-business publish
- name: Get version
id: version
run: echo version="$REF_BRANCH" | sed -e 's/release-//g' >> $GITHUB_OUTPUT
- name: Create GitHub release
run: gh release create ${{ steps.version.outputs.version }} --title ${{ steps.version.outputs.version }} --notes "$CHANGELOG"