expose static binaries in gitlab artifacts again

This commit is contained in:
Charles Hall 2024-12-11 14:35:53 -08:00
parent 94c1a39437
commit 1e050c8983
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
3 changed files with 21 additions and 1 deletions

4
.gitignore vendored
View file

@ -10,8 +10,10 @@ target
# Nix artifacts # Nix artifacts
result* result*
# GitLab CI cache # GitLab CI artifacts
/.gitlab-ci.d /.gitlab-ci.d
/grapevine-static-aarch64-unknown-linux-musl
/grapevine-static-x86_64-unknown-linux-musl
# mdbook artifacts # mdbook artifacts
/public /public

View file

@ -63,6 +63,10 @@ artifacts:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script: script:
- direnv exec . job artifacts - direnv exec . job artifacts
artifacts:
paths:
- grapevine-static-aarch64-unknown-linux-musl
- grapevine-static-x86_64-unknown-linux-musl
pages: pages:
stage: deploy stage: deploy

14
bin/job
View file

@ -4,6 +4,20 @@ job_artifacts() (
set -euo pipefail set -euo pipefail
nix-build-and-cache packages nix-build-and-cache packages
# Subsequent `nix build` calls should be fast because the above line ensures
# the packages have been built already.
packages=(
static-aarch64-unknown-linux-musl
static-x86_64-unknown-linux-musl
)
for x in "${packages[@]}"; do
nix build ".#$x"
cp result/bin/grapevine grapevine-"$x"
chmod u+w grapevine-"$x"
done
) )
job_ci() ( job_ci() (