-
Notifications
You must be signed in to change notification settings - Fork 220
63 lines (55 loc) · 2.01 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
name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'MAJOR.MINOR.PATCH'
release_notes:
description: 'Release Notes'
required: true
jobs:
create_draft_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check version has the right format
run: |
[[ "${{ github.event.inputs.version }}" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]
- name: Update version and push to tag
run: |
cd v2
mv manifest_base.json manifest_unversioned.json
jq '.version="${{ github.event.inputs.version }}"' manifest_unversioned.json > manifest_base.json
git config user.name ${{ github.actor }}
git config user.email [email protected]
git add manifest_base.json
git commit -m "Automated commit: Bump to version ${{ github.event.inputs.version }}"
git tag v${{ github.event.inputs.version }}
git push origin v${{ github.event.inputs.version }}
- name: Install deps
run: sudo npm install -g @angular/cli
- name: Build the extension
run: cd v2 && make crx.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
body: ${{ github.event.inputs.release_notes }}
draft: true
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: v2/crx.zip
asset_name: crx_${{ github.event.inputs.version }}.zip
asset_content_type: application/zip