-
-
Notifications
You must be signed in to change notification settings - Fork 13
56 lines (50 loc) · 1.69 KB
/
build-extension.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
# This workflow will build the extension and upload an artifact
name: Build and upload extension
on:
push:
branches: '**'
pull_request:
branches: '**'
release:
types: [published]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends make gettext gnome-shell libglib2.0-bin
- name: Build the extension bundle
run: |
make build
- name: Run checks on extension
run: |
make check
- uses: actions/upload-artifact@v3
with:
name: [email protected]
path: build/[email protected]
- name: Upload extension bundle to release
uses: actions/github-script@v6
if: startsWith(github.ref, 'refs/tags/v')
with:
script: |
const fs = require('fs');
const tag = context.ref.replace('refs/tags/', '');
//Get release for this tag
const release = await github.rest.repos.getReleaseByTag({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
tag
});
//Upload
const bundleName = '[email protected]';
await github.rest.repos.uploadReleaseAsset({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
release_id: release.data.id,
name: bundleName,
data: await fs.readFileSync('build/' + bundleName)
});