Simplify ci logic

This commit is contained in:
Greg Hellings
2025-08-09 14:47:01 +00:00
parent b7b096e76f
commit 841e39fdb5
4 changed files with 129 additions and 129 deletions
+54
View File
@@ -0,0 +1,54 @@
stages:
- check
- build
- release
include:
- local: .gitlab/ci/check.yml
build:
stage: build
needs:
- job: check
artifacts: true
parallel:
matrix:
- ARCH: [x86, ucrt]
tags:
- nix
script:
- nix run -L ".#${ARCH}"
- ls -l
- URL=$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/sword-utils/$TAG/sword-${ARCH}-${TAG}.tar.xz
- >-
if [ "$CI_PIPELINE_SOURCE" == "tag" ]; then
curl -i --fail-with-body --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./sword.tar.xz "${URL}"
fi
- echo "${ARCH}_TARBALL=${URL}" > "build.env.${ARCH}"
artifacts:
reports:
dotenv: build.env.$ARCH
"Create release":
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
tags:
- docker
rules:
- if: $CI_PIPELINE_SOURCE == "tag"
needs:
- job: check
artifacts: true
- job: build
artifacts: true
script: echo "Tagging as released"
release:
name: Release $TAG
tag_name: "$TAG"
description: Automatic SWORD utils build for Windows
assets:
links:
- name: Windows (x86-64) release
url: "${x86_TARBALL}"
- name: Windows (x86-64) release with UCRT
url: "${ucrt_TARBALL}"