-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (66 loc) · 2.15 KB
/
build_updated_packages.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
name: Build updated packages
on:
push:
paths-ignore:
- '.github/workflows/**'
- 'keyring.asc'
permissions:
id-token: write
contents: read
attestations: write
jobs:
evaluate:
name: Evaluate changed packages
runs-on: ubuntu-24.04
outputs:
packages: ${{ steps.get-packages.outputs.packages }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Figure out which packages have changed since the last push
id: get-packages
run: |
echo "packages=["$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -v '^\(\.git\|keyring.asc\)' | sed 's/\/.*$//g' | sort -u | xargs -I{} bash -c "test -d \"{}\" && echo \"\\\"{}\\\"\"" | head -c -1 | sed -z 's/\n/,/g')"]" >> $GITHUB_OUTPUT
build:
name: Build
needs: evaluate
runs-on: ubuntu-24.04
strategy:
matrix:
pkgname: ${{ fromJSON(needs.evaluate.outputs.packages) }}
fail-fast: false
if: ${{ needs.evaluate.outputs.packages != '[]' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: buildsrc
- name: Prepare build environment
run: |
sudo chown -R 1000 buildsrc
sudo chown -R $(id -u) buildsrc/.git
sudo install -d -o 1000 -g users repo
- name: Use geschenkerbauer to build packages
uses: mutantmonkey/geschenkerbauer/action@e43cb6ec019de63c4002d092f2489c37c7346501
env:
GNUPG_PUBKEYRING: ${{ github.workspace }}/buildsrc/keyring.asc
PACKAGER: geschenkerbauer on github <[email protected]>
with:
packages: ${{ matrix.pkgname }}
- name: Replace forbidden colon character in package filenames
run: |
for f in $(find . -iname '*:*'); do
sudo mv "$f" "${f/:/__3A__}"
done || exit 0
working-directory: ./repo
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-output-${{ matrix.pkgname }}
path: repo
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: 'repo/*'