mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 09:01:55 +00:00
feat(ci)!: switch to rpmbuild (#2792)
* feat(ci)!: switch to rpmbuild * fix: support extra_repos * let's try this instead * fix the funny condition * fix: disable gpgcheck This should be fine because checksum is checked for the repomd and the packages too
This commit is contained in:
@@ -52,26 +52,26 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout latest Mock configs
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
repository: terrapkg/mock-configs
|
||||
path: mock-configs
|
||||
|
||||
- name: Set up git repository
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
- name: Include custom build template instead of package default
|
||||
- name: CI Setup Script
|
||||
run: |
|
||||
cp -v mock-configs/terra.tpl /etc/mock/templates/terra.tpl
|
||||
dir=$(dirname ${{ matrix.pkg.pkg }})
|
||||
if [ -f $dir/ci_setup.rhai ]; then
|
||||
anda run $dir/ci_setup.rhai --labels script_path=$dir/ci_setup.rhai
|
||||
fi
|
||||
|
||||
- name: Install Build Dependencies
|
||||
run: |
|
||||
dir=$(dirname ${{ matrix.pkg.pkg }})
|
||||
dnf5 builddep -y ${dir}/*.spec
|
||||
|
||||
- name: Build with Andaman
|
||||
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c mock-configs/terra-${{ matrix.version }}-${{ matrix.pkg.arch }}.cfg
|
||||
run: anda build ${{ matrix.pkg.pkg }} -rrpmbuild
|
||||
|
||||
- name: Build with Andaman (alternate arch)
|
||||
if: |
|
||||
matrix.pkg.arch == 'x86_64' && matrix.pkg.labels['multilib']
|
||||
if: matrix.pkg.arch == 'x86_64' && matrix.pkg.labels['multilib']
|
||||
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c mock-configs/terra-${{ matrix.version }}-i386.cfg
|
||||
|
||||
- name: Generating artifact name
|
||||
|
||||
@@ -16,7 +16,9 @@ jobs:
|
||||
options: --cap-add=SYS_ADMIN --privileged
|
||||
steps:
|
||||
- name: Install repositories
|
||||
run: dnf5 install -y --setopt=install_weak_deps=False mock curl wget git-core openssl-devel cargo podman fuse-overlayfs
|
||||
run: |
|
||||
dnf5 install -y --setopt=install_weak_deps=False curl wget git-core openssl-devel cargo podman fuse-overlayfs
|
||||
dnf5 builddep -y anda/terra/{mock-configs,srpm-macros}/*.spec anda/tools/buildsys/{anda,subatomic}/*.spec
|
||||
|
||||
- name: Install Anda
|
||||
run: cargo install anda
|
||||
@@ -30,20 +32,20 @@ jobs:
|
||||
echo "PATH=$PATH:/github/home/.cargo/bin" >> $GITHUB_ENV
|
||||
export PATH=$PATH:/github/home/.cargo/bin
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
anda build -c fedora-${{ matrix.version }}-${{ matrix.arch }} anda/terra/mock-configs/pkg -p rpm
|
||||
anda build -rrpmbuild anda/terra/mock-configs/pkg
|
||||
- name: Install terra-mock-configs
|
||||
run: dnf5 install -y anda-build/rpm/rpms/terra-mock-configs*.rpm
|
||||
|
||||
- name: Build anda-srpm-macros
|
||||
run: anda build -c terra-${{ matrix.version }}-${{ matrix.arch }} anda/terra/srpm-macros/pkg
|
||||
run: anda build -rrpmbuild anda/terra/srpm-macros/pkg
|
||||
|
||||
- name: Build Subatomic
|
||||
run: anda build -c terra-${{ matrix.version }}-${{ matrix.arch }} anda/tools/buildsys/subatomic/pkg
|
||||
run: anda build -rrpmbuild anda/tools/buildsys/subatomic/pkg
|
||||
- name: Install Subatomic
|
||||
run: dnf5 install -y ./anda-build/rpm/rpms/subatomic-*.rpm
|
||||
|
||||
- name: Build Andaman
|
||||
run: anda build -c terra-${{ matrix.version }}-${{ matrix.arch }} anda/tools/buildsys/anda/pkg
|
||||
run: anda build -rrpmbuild anda/tools/buildsys/anda/pkg
|
||||
|
||||
- name: Upload packages to subatomic
|
||||
run: |
|
||||
|
||||
@@ -57,21 +57,18 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout latest Mock configs
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: terrapkg/mock-configs
|
||||
path: mock-configs
|
||||
|
||||
- name: Set up git repository
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
- name: Include custom build template instead of package default
|
||||
- name: CI Setup Script
|
||||
run: |
|
||||
cp -v mock-configs/terra.tpl /etc/mock/templates/terra.tpl
|
||||
dir=${{ matrix.pkg }}
|
||||
if [ -f $dir/ci_setup.rhai ]; then
|
||||
anda run $dir/ci_setup.rhai --labels script_path=$dir/ci_setup.rhai
|
||||
fi
|
||||
|
||||
- name: Build with Andaman
|
||||
run: anda build anda/${{ matrix.pkg }}pkg --package rpm -c mock-configs/terra-${{ matrix.version }}-${{ matrix.arch }}.cfg
|
||||
run: anda build -rrpmbuild anda/${{ matrix.pkg }}pkg
|
||||
|
||||
- name: Generating artifact name
|
||||
id: art
|
||||
|
||||
@@ -23,21 +23,23 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout latest Mock configs
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: terrapkg/mock-configs
|
||||
path: mock-configs
|
||||
|
||||
- name: Set up git repository
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
- name: Include custom build template instead of package default
|
||||
- name: CI Setup Script
|
||||
run: |
|
||||
cp -v mock-configs/terra.tpl /etc/mock/templates/terra.tpl
|
||||
dir=$(dirname ${{ matrix.pkg.pkg }})
|
||||
if [ -f $dir/ci_setup.rhai ]; then
|
||||
anda run $dir/ci_setup.rhai --labels script_path=$dir/ci_setup.rhai
|
||||
fi
|
||||
|
||||
- name: Install Build Dependencies
|
||||
run: |
|
||||
dir=$(dirname ${{ matrix.pkg.pkg }})
|
||||
dnf5 builddep -y ${dir}/*.spec
|
||||
|
||||
- name: Build with Andaman
|
||||
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c mock-configs/terra-${{ matrix.version }}-${{ matrix.pkg.arch }}.cfg
|
||||
run: anda build ${{ matrix.pkg.pkg }} -rrpmbuild
|
||||
|
||||
- name: Generating artifact name
|
||||
id: art
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
import "andax/ci/extra_repos.rhai" as extra_repos;
|
||||
extra_repos::install(labels);
|
||||
@@ -0,0 +1,2 @@
|
||||
import "andax/ci/extra_repos.rhai" as extra_repos;
|
||||
extra_repos::install(labels);
|
||||
@@ -0,0 +1,26 @@
|
||||
import "anda::cfg" as cfg;
|
||||
|
||||
fn install(labels) {
|
||||
if labels.script_path == () {
|
||||
print("fatal: labels.script_path is empty");
|
||||
terminate();
|
||||
}
|
||||
let releasever = sh("rpm -E '%fedora'", #{"stdout": "piped"}).ctx.stdout;
|
||||
releasever.trim();
|
||||
let basearch = sh("rpm -E '%_arch'", #{"stdout": "piped"}).ctx.stdout;
|
||||
basearch.trim();
|
||||
let hcl = cfg::load_file(sub(`(.+/)[^.]+\.rhai`, "${1}anda.hcl", labels.script_path));
|
||||
for repo in hcl.project.pkg.rpm.extra_repos {
|
||||
repo = sub(`\$releasever`, releasever, repo);
|
||||
repo = sub(`\$basearch`, basearch, repo);
|
||||
let filename = sub(`\W`, "_", repo);
|
||||
let file = open_file(`/etc/yum.repos.d/${filename}.repo`);
|
||||
file.write(`
|
||||
[filename]
|
||||
name=${filename}
|
||||
baseurl=${repo}
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user