-
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 2.06 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
name: Build and release extension
on:
workflow_dispatch:
inputs:
version:
description: 'Version number for this release'
required: true
previous_version:
description: 'Previous Version'
required: true
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Update versions
id: update-versions
run: |
sed -i "s/${{ github.event.inputs.previous_version }}/${{ github.event.inputs.version }}/g" manifest.chrome.json
sed -i "s/${{ github.event.inputs.previous_version }}/${{ github.event.inputs.version }}/g" manifest.firefox.json
- name: Build Chrome and Firefox release
run: npm run build
- name: Create Chrome ZIP
run: |
cd dist/chrome
zip -r ../../workforce-mate-chrome-${{ github.event.inputs.version }}.zip *
cd ../..
- name: Create Firefox ZIP
run: |
cd dist/firefox
zip -r ../../workforce-mate-firefox-${{ github.event.inputs.version }}.zip *
cd ../..
- name: Commit changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add manifest.chrome.json manifest.firefox.json
git commit -m "Update version to ${{ github.event.inputs.version }}"
git push
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
name: Workforce Mate v${{ github.event.inputs.version }}
body_path: ./changelog.md
files: |
workforce-mate-chrome-${{ github.event.inputs.version }}.zip
workforce-mate-firefox-${{ github.event.inputs.version }}.zip