-
Notifications
You must be signed in to change notification settings - Fork 102
70 lines (60 loc) · 2.29 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
# release.yml
# bump a new version, create a new tag, and create a release in Github Releases
name: release
on:
workflow_dispatch:
inputs:
version:
description: 'Input a new version number to release. (e.g. 1.2.3)'
required: true
run-name: Release v${{github.event.inputs.version}}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: "yarn"
- name: Bump version
id: bump-version
run: |
yarn install
yarn run update-version ${{github.event.inputs.version}}
- name: exit if failed to update new version
if: ${{ github.steps.bump-version != 0}}
run: |
echo ${{ github.steps.bump-version}}
exit 1
- name: Create release commit and tag
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "chore(release): v${{github.event.inputs.version}}"
git tag -a v${{github.event.inputs.version}} -m "Release v${{github.event.inputs.version}}"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
git push origin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
yarn install
yarn run build
- name: Zip to hypercrx.zip
run: zip -j release/hypercrx.zip build/*
- name: Append version to release file names
run: |
cp release/hypercrx.crx ${{format('release/hypercrx-{0}.crx', github.event.inputs.version)}}
cp release/hypercrx.zip ${{format('release/hypercrx-{0}.zip', github.event.inputs.version)}}
- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.create_changelog.outputs.changelog }}
generate_release_notes: true
files: |
${{format('release/hypercrx-{0}.crx', github.event.inputs.version)}}
${{format('release/hypercrx-{0}.zip', github.event.inputs.version)}}
tag_name: v${{github.event.inputs.version}}