From ebde95c29f427aa9c5d22e8d3ad15b8cd1d43760 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 22 Oct 2024 13:57:46 +0200 Subject: [PATCH] Add tarball script for CI Allows the same script to be executed by GitLab and Gitea runners. --- .gitea/workflows/ci.yaml | 9 +++++++++ .gitlab-ci.yml | 12 +----------- ci/make-tarball.sh | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 .gitea/workflows/ci.yaml create mode 100644 ci/make-tarball.sh diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..8e2dd4e --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -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 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33db893..d344286 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,14 +13,4 @@ build:lagarto-ox-tarball: - nix script: - 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 - - 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" + - ci/make-tarball.sh result && rm result diff --git a/ci/make-tarball.sh b/ci/make-tarball.sh new file mode 100644 index 0000000..01b2e75 --- /dev/null +++ b/ci/make-tarball.sh @@ -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"