-
-
Notifications
You must be signed in to change notification settings - Fork 63
88 lines (75 loc) · 2.74 KB
/
Copy pathbuild.yml
File metadata and controls
88 lines (75 loc) · 2.74 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
name: Build extension zip
on:
push:
branches: [typescript]
tags: ["v*"]
pull_request:
branches: [typescript]
workflow_dispatch:
# Read by default. The release job below opts into write.
permissions:
contents: read
env:
UUID: hanabi-extension@jeffshee.github.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson ninja-build gettext libglib2.0-bin
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- name: Install npm dependencies
run: npm ci
- name: Build TypeScript sources
run: npm run build
- name: Assemble extension into a staging prefix
run: |
meson setup .build-ci --prefix=/usr
DESTDIR="${GITHUB_WORKSPACE}/staging" meson install -C .build-ci
- name: Package zip installable with `gnome-extensions install`
run: |
ext="${GITHUB_WORKSPACE}/staging/usr/share/gnome-shell/extensions/${UUID}"
# meson installs the gschema XML under the glib prefix; an installable
# zip needs the schema (compiled) inside the extension's own schemas/ dir.
mkdir -p "${ext}/schemas"
cp "${GITHUB_WORKSPACE}"/staging/usr/share/glib-2.0/schemas/*.gschema.xml "${ext}/schemas/"
glib-compile-schemas "${ext}/schemas/"
mkdir -p "${GITHUB_WORKSPACE}/dist"
( cd "${ext}" && zip -qr "${GITHUB_WORKSPACE}/dist/${UUID}.shell-extension.zip" . )
echo "Packaged:"
unzip -l "${GITHUB_WORKSPACE}/dist/${UUID}.shell-extension.zip"
# archive: false uploads the file as-is without GitHub's zip wrapper.
- name: Upload zip artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.UUID }}.shell-extension.zip
path: dist/${{ env.UUID }}.shell-extension.zip
archive: false
if-no-files-found: error
# Separate job so write permission is granted only when publishing a release.
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download zip artifact
uses: actions/download-artifact@v8
with:
name: ${{ env.UUID }}.shell-extension.zip
path: dist
# Keep the .zip as-is; do not decompress the downloaded file.
skip-decompress: true
- name: Attach zip to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "${GITHUB_REF_NAME}" dist/*.shell-extension.zip --generate-notes