-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.82 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
69
70
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create changelog for release
id: github_release
uses: mikepenz/release-changelog-builder-action@v4
with:
configuration: 'changelog.config.json'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
body: ${{ steps.github_release.outputs.changelog }}
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha')}}
deploy:
needs: [ release ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set env variables
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install
run: npm install
- name: Build
run: npx lerna run build
- name: Version
run: npx lerna version $RELEASE_VERSION --yes --no-private --force-publish --no-git-tag-version
- name: Publish CLI
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/cli
- name: Publish React
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/react
- name: Rollback Release
if: failure()
uses: author/action-rollback@stable
with:
tag: ${{ env.RELEASE_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}