-
-
Notifications
You must be signed in to change notification settings - Fork 7
95 lines (87 loc) · 2.99 KB
/
autobuild.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
# for each folder in ultramarine/
# generate a new workflow for each folder in ultramarine/
name: Automatically build packages
on:
push:
paths:
- ultramarine/**
branches:
- um41
pull_request:
branches:
- um41
workflow_dispatch:
workflow_call:
jobs:
manifest:
runs-on: ubuntu-latest
outputs:
build_matrix: ${{ steps.generate_build_matrix.outputs.build_matrix }}
container:
image: ghcr.io/terrapkg/builder:f41
options: --cap-add=SYS_ADMIN --privileged
steps:
- name: Set workspace as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate build matrix
id: generate_build_matrix
run: anda ci >> $GITHUB_OUTPUT
build:
needs: manifest
strategy:
matrix:
version: ["41"]
pkg: ${{ fromJson(needs.manifest.outputs.build_matrix) }}
fail-fast: false
runs-on: ${{ matrix.pkg.arch == 'aarch64' && 'arm64' || 'ubuntu-latest' }}
container:
image: ghcr.io/terrapkg/builder:f${{ matrix.version }}
options: --cap-add=SYS_ADMIN --privileged
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up git repository
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Cache buildroot
id: br-cache
uses: actions/cache@v4
with:
path: /var/cache
key: ${{ runner.os }}-br-${{ matrix.version }}-${{ matrix.pkg.arch }}
- name: Include custom build template instead of package default
run: |
cp -v ultramarine/ultramarine-mock-configs/ultramarine.tpl /etc/mock/templates/ultramarine.tpl
- name: Build with Andaman
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c ultramarine/ultramarine-mock-configs/ultramarine-${{ matrix.version }}-${{ matrix.pkg.arch }}.cfg
- name: Generating artifact name
id: art
run: |
NAME=${{ matrix.pkg.pkg }}-${{ matrix.pkg.arch }}-${{ matrix.version }}
x=${NAME//\//@}
echo "name=$x" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.art.outputs.name }}
path: |
anda-build/rpm/rpms/*
anda-build/rpm/srpm/*
- name: Upload packages to subatomic
if: github.event_name == 'push'
run: |
subatomic-cli upload --prune \
--server https://subatomic.fyralabs.com \
--token ${{ secrets.SUBATOMIC_TOKEN }} \
um${{ matrix.version }} anda-build/rpm/rpms/*
- name: Upload source packages to subatomic
if: github.event_name == 'push'
run: |
subatomic-cli upload --prune \
--server https://subatomic.fyralabs.com \
--token ${{ secrets.SUBATOMIC_TOKEN }} \
um${{ matrix.version }}-source anda-build/rpm/srpm/*