-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (63 loc) · 2.4 KB
/
continuous-delivery.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
71
72
73
74
75
76
name: Continuous Delivery
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "14"
- name: Cache Node.js dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install Node.js dependencies
run: npm ci
- name: Get the tag version
id: release_info
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Update extension version in manifest.json
run: |
npx dot-json@1 src/manifest.json version $(echo ${{ steps.release_info.outputs.VERSION }} | sed 's/^v//g')
- name: Build extension
run: |
npm run build
cd dist
zip -r ../hackstoshort_${{ steps.release_info.outputs.VERSION }}.chromium.zip *
zip -r ../hackstoshort_${{ steps.release_info.outputs.VERSION }}.firefox.xpi *
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release_info.outputs.VERSION }}
release_name: ${{ steps.release_info.outputs.VERSION }}
draft: false
prerelease: ${{ contains(github.ref, 'rc') }}
- name: Upload Chromium package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: hackstoshort_${{ steps.release_info.outputs.VERSION }}.chromium.zip
asset_name: hackstoshort_${{ steps.release_info.outputs.VERSION }}.chromium.zip
asset_content_type: application/zip
- name: Upload Firefox package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: hackstoshort_${{ steps.release_info.outputs.VERSION }}.firefox.xpi
asset_name: hackstoshort_${{ steps.release_info.outputs.VERSION }}.firefox.xpi
asset_content_type: application/zip