Repository navigation
202 lines (173 loc) · 6.9 KB
/
Copy pathbuild-packages.yaml
File metadata and controls
202 lines (173 loc) · 6.9 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: Build packages
on:
push:
branches: ['master']
tags: '*'
pull_request:
jobs:
build-packages:
strategy:
matrix:
target-os: [ debian-13, ubuntu-2404, ubuntu-2604, fedora-43, fedora-44, arch, opensuse-tumbleweed ]
recipe: [ lact, lact-headless ]
include:
- target-os: rhel-8
recipe: lact-headless
- target-os: rhel-9
recipe: lact-headless
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Docker Cache
uses: AndreKurait/docker-cache@7a3887908bdb97935395833df69b060cfcca0f7f # 0.7.0
with:
key: docker-${{ matrix.target-os }}-${{ hashFiles('pkg/images/') }}
- name: Import gpg key
run: |
echo -n "$GPG_KEY" | base64 -d > /tmp/package-signing-key.gpg
echo -n "$GPG_KEY" | base64 -d | gpg --import || true
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
# TODO: remove this later, potential cause: https://github.com/moby/moby/issues/51665
- name: Fix docker
run: |
sudo tee /etc/docker/daemon.json <<EOF
{
"storage-driver": "overlay2"
}
EOF
sudo systemctl restart docker
docker info
- name: Install pkger
run: |
curl -L -o /usr/local/bin/pkger https://github.com/ilya-zlobintsev/pkger/releases/download/v0.11.5/pkger
chmod +x /usr/local/bin/pkger
# A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- name: Build packages (with signing)
if: ${{ (contains(matrix.target-os, 'fedora') || contains(matrix.target-os, 'opensuse') || matrix.target-os == 'rhel-9') && env.GPG_KEY_PASSWORD != '' }}
run: pkger -t -c .pkger.yml build ${{ matrix.recipe }} -i ${{ matrix.target-os }}
env:
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
- name: Build packages (without signing)
if: ${{ !(contains(matrix.target-os, 'fedora') || contains(matrix.target-os, 'opensuse') || matrix.target-os == 'rhel-9') || env.GPG_KEY_PASSWORD == '' }}
run: pkger -t -c .pkger.yml build --no-sign ${{ matrix.recipe }} -i ${{ matrix.target-os }}
env:
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
- name: Copy release files
run: |
OUT_DIR=$PWD/release-artifacts
mkdir -p $OUT_DIR
pushd pkg/output
for DISTRO in $(ls); do
cd $DISTRO
rm -f *.src.rpm
for FILE in $(ls); do
NAME="${FILE%.*}"
EXT="${FILE##*.}"
OUT_NAME="$OUT_DIR/$NAME.$DISTRO.$EXT"
cp $FILE $OUT_NAME
done
cd ..
done
popd
- name: Save gpg key
run: |
gpg --armor --export > $PWD/release-artifacts/lact.pubkey
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ matrix.target-os }}-${{ matrix.recipe }}
path: release-artifacts/*
build-flatpak:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-47
options: --privileged
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: flatpak/flatpak-github-actions/flatpak-builder@79327416609af08178ad73b352877e51450790b3 # v6
with:
bundle: io.github.ilya_zlobintsev.LACT.flatpak
manifest-path: flatpak/io.github.ilya_zlobintsev.LACT.yaml
cache-key: flatpak-builder-${{ github.sha }}
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: flatpak
path: io.github.ilya_zlobintsev.LACT.flatpak
build-docker:
runs-on: ubuntu-latest
steps:
- name: Log into GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker image metadata
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6
with:
images: ghcr.io/${{ github.repository }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- name: Build and push
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
with:
file: pkg/docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
create-test-release:
needs: [build-packages, build-flatpak]
runs-on: ubuntu-latest
if: (github.event_name == 'push' && github.ref == 'refs/heads/master')
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: downloaded-artifacts/
pattern: "!*.dockerbuild"
- name: Create release
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
removeArtifacts: true
allowUpdates: true
artifactErrorsFailBuild: false
artifacts: "downloaded-artifacts/*/*"
body: ${{ github.event.head_commit.message }}
prerelease: true
name: Test release
tag: test-build
- name: Update test-build tag
run: |
git tag -f test-build
git push -f origin test-build
shell: bash
create-stable-release:
needs: [build-packages, build-flatpak]
runs-on: ubuntu-latest
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: downloaded-artifacts/
pattern: "!*.dockerbuild"
- name: Create release
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
artifacts: "downloaded-artifacts/*/*"
name: ${{ github.ref_name }}
tag: ${{ github.ref_name }}
body: ${{ github.ref_name }} changelog goes here
draft: true