-
Notifications
You must be signed in to change notification settings - Fork 7
135 lines (114 loc) · 3.41 KB
/
ci.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
name: CI
"on":
pull_request:
push:
schedule:
- cron: '29 4 1 * *'
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
go:
- 1.18.x # ubuntu jammy
- 1.19.x # debian bookworm
- 1.20.x
- 1.x # latest
include:
- staticcheck: latest
- go: 1.18.x
staticcheck: v0.3
- go: 1.19.x
staticcheck: v0.3
name: go${{ matrix.go }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: true
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y -q appstream-util gettext libgtk-3-dev \
libxml2-utils shellcheck yamllint
go install \
honnef.co/go/tools/cmd/staticcheck@${{ matrix.staticcheck }}
- run: go mod graph
- run: make
- run: make check
- run: make test
flatpak-config:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: false # No go code will be compiled, do not cache nothing.
- run: go mod graph
- run: make -B flatpak/modules.txt
- run: make -B flatpak/appcenter.yml
- run: make -B flatpak/flathub.yml
- name: Upload flatpak-config artifact
uses: actions/upload-artifact@v3
with:
name: flatpak-config
if-no-files-found: error
path: |
flatpak/modules.txt
flatpak/*.yml
flatpak-builder:
strategy:
matrix:
arch:
- aarch64
- x86_64
repo:
- appcenter
- flathub
include:
- repo: appcenter
repo-url: https://flatpak.elementary.io/repo.flatpakrepo
image: ghcr.io/elementary/flatpak-platform/runtime:7.2
- repo: flathub
repo-url: https://flathub.org/repo/flathub.flatpakrepo
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
name: ${{ matrix.repo }}-${{ matrix.arch }}
needs: flatpak-config
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
options: --privileged
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download flatpak-config artifact
uses: actions/download-artifact@v3
with:
name: flatpak-config
path: flatpak
- name: Configuring build
run: tools/app-version.sh | tee tools/app-version.txt
- name: Install QEMU dependencies
if: ${{ matrix.arch == 'aarch64' && matrix.repo == 'flathub' }}
run: dnf -y install docker
- name: Initialize QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
manifest-path: flatpak/${{ matrix.repo }}.yml
repository-name: ${{ matrix.repo }}
repository-url: ${{ matrix.repo-url }}
arch: ${{ matrix.arch }}
bundle: xkcd-gtk-${{ matrix.repo }}.flatpak
verbose: true