forked from ChimeraOS/chimeraos
-
Notifications
You must be signed in to change notification settings - Fork 5
129 lines (116 loc) · 3.99 KB
/
main.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
name: System image build
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
push:
branches:
- unstable*
workflow_dispatch:
jobs:
build-docker-image:
name: Build and publish docker container
uses: ./.github/workflows/build-builder.yml
list-pkgbuilds:
name: List Packages
runs-on: ubuntu-latest
outputs:
aur-pkgs: ${{ steps.set-aur-pkgs.outputs.matrix }}
pkgs: ${{ steps.set-pkgs.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-aur-pkgs
run: source ./manifest ; echo "matrix=$(echo ${AUR_PACKAGES} | jq -R -s -c 'split(" ")')" >> $GITHUB_OUTPUT
shell: bash
- id: set-pkgs
run: echo "matrix=$(ls -d pkgs/*/ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
shell: bash
aur-pkgbuild:
needs:
- build-docker-image
- list-pkgbuilds
name: Build AUR package
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
package: ${{ fromJson(needs.list-pkgbuilds.outputs.aur-pkgs) }}
steps:
- uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build packages
run: |
docker pull ${{ steps.meta.outputs.tags }}
docker run --rm -v $(pwd):/workdir --entrypoint=/workdir/aur-pkgs/build-aur-package.sh ${{ steps.meta.outputs.tags }} ${{ matrix.package }}
- name: Process package name
id: process_package
run: |
PACKAGE_NAME=${{ matrix.package }}
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
- name: Generate checksums
run: |
docker run --rm -v $(pwd):/workdir --entrypoint=/bin/bash ${{ steps.meta.outputs.tags }} -c "cd /workdir/aur-pkgs && sha256sum *.pkg.tar* > sha256sums-${PACKAGE_NAME}.txt"
- name: Upload Package Archives
uses: actions/upload-artifact@v4
env:
PACKAGE_NAME: ${{ env.PACKAGE_NAME }}
with:
name: AUR-packages-${{ env.PACKAGE_NAME }}
path: |
aur-pkgs/*.pkg.tar*
aur-pkgs/sha256sums-${PACKAGE_NAME}.txt
compression-level: 0
pkgbuild:
needs:
- build-docker-image
- list-pkgbuilds
name: Build package
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
package: ${{ fromJson(needs.list-pkgbuilds.outputs.pkgs) }}
steps:
- uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build packages
run: |
docker pull ${{ steps.meta.outputs.tags }}
docker run --rm -v $(pwd):/workdir --entrypoint=/workdir/pkgs/build-package.sh ${{ steps.meta.outputs.tags }} ${{ matrix.package }}
- name: Process package name
id: process_package
run: |
PACKAGE_NAME=${{ matrix.package }}
PACKAGE_NAME=${PACKAGE_NAME#pkgs/}
PACKAGE_NAME=${PACKAGE_NAME%/}
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
- name: Generate checksums for pkgs
run: |
docker run --rm -v $(pwd):/workdir --entrypoint=/bin/bash ${{ steps.meta.outputs.tags }} -c "cd /workdir/pkgs && sha256sum *.pkg.tar* > sha256sums-${PACKAGE_NAME}.txt"
- name: Upload Package Archives
uses: actions/upload-artifact@v4
env:
PACKAGE_NAME: ${{ env.PACKAGE_NAME }}
with:
name: Packages-${{ env.PACKAGE_NAME }}
path: |
pkgs/*.pkg.tar*
pkgs/sha256sums-${PACKAGE_NAME}.txt
compression-level: 0
build:
needs:
- build-docker-image
- aur-pkgbuild
- pkgbuild
name: Build ChimeraOS UNSTABLE image
uses: ./.github/workflows/build-system-image.yml
with:
postfix: "[UNSTABLE]"