-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (58 loc) · 2.15 KB
/
build-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
name: Build and Release
on:
push:
tags:
- "@ic-reactor/core@*"
workflow_dispatch:
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
cache: "yarn"
- name: Install Yarn
run: npm install -g yarn
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn build
- name: Get Core Package Version
id: core-version
run: echo "CORE_VERSION=$(jq -r '.version' ./packages/core/package.json)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.RELEASE_TOKEN }}
name: "Core Bundle v${{ env.CORE_VERSION }}"
tag_name: "v${{ env.CORE_VERSION }}"
body: |
For production use:
```html
<script src="https://github.com/B3Pay/ic-reactor/releases/download/v${{ env.CORE_VERSION }}/ic-reactor-core.min.js"></script>
```
For development use:
```html
<script src="https://github.com/B3Pay/ic-reactor/releases/download/v${{ env.CORE_VERSION }}/ic-reactor-core.js"></script>
```
files: |
./packages/core/umd/production/ic-reactor-core.min.js
./packages/core/umd/development/ic-reactor-core.js
./packages/core/umd/development/ic-reactor-core.js.map
draft: false
prerelease: false
generate_release_notes: true
- name: Update README.md
run: |
sed -i "s/releases\/download\/.*\/ic-reactor-core.min.js/releases\/download\/v${{ env.CORE_VERSION }}\/ic-reactor-core.min.js/" README.md
- name: Commit and Push if changed
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md
git diff --staged --quiet || git commit -m "Update README.md to point to the latest release"
git diff --staged --quiet || git push