Add tarball script for CI
Some checks failed
CI / build:lagarto-ox-tarball (push) Failing after 5s

Allows the same script to be executed by GitLab and Gitea runners.
This commit is contained in:
Rodrigo Arias 2024-10-22 13:57:46 +02:00
parent 81bd11999a
commit ebde95c29f
3 changed files with 26 additions and 11 deletions

9
.gitea/workflows/ci.yaml Normal file
View File

@ -0,0 +1,9 @@
name: CI
on: push
jobs:
build:lagarto-ox-tarball:
runs-on: native
steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4
- run: ci/make-tarball.sh

View File

@ -13,14 +13,4 @@ build:lagarto-ox-tarball:
- nix - nix
script: script:
- nix build -L .#nixosConfigurations.lagarto-ox.pkgs.fpga-tarball - nix build -L .#nixosConfigurations.lagarto-ox.pkgs.fpga-tarball
- cd result - ci/make-tarball.sh result && rm result
- out=/ceph/home/gitlab-runner/public_html/nixos-riscv/
- fn=$(ls | head -1)
- cp $fn $out/$fn
- rm -f $out/latest.tar.zst
- ln -s $out/$fn $out/latest.tar.zst
- cd ..
- rm result
- |
echo "Pinned: https://jungle.bsc.es/~gitlab-runner/nixos-riscv/$fn"
echo "Latest: https://jungle.bsc.es/~gitlab-runner/nixos-riscv/latest.tar.zst"

16
ci/make-tarball.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
nix build -L '.#nixosConfigurations.lagarto-ox.pkgs.fpga-tarball'
cd result
out=/ceph/home/gitlab-runner/public_html/nixos-riscv/
fn=$(ls | head -1)
cp "$fn" "$out/$fn"
rm -f "$out/latest.tar.zst"
ln -s "$out/$fn" "$out/latest.tar.zst"
rm result
echo "Pinned: https://jungle.bsc.es/~gitlab-runner/nixos-riscv/$fn"
echo "Latest: https://jungle.bsc.es/~gitlab-runner/nixos-riscv/latest.tar.zst"