Somehow I'm ending up with no file. Try to diagnose why, but also try to fix it at the same problem without being 100% sure of the root cause
63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
stages:
|
|
- check
|
|
- build
|
|
- release
|
|
|
|
check:
|
|
stage: check
|
|
tags:
|
|
- nix
|
|
script:
|
|
- nix flake check
|
|
- TAG=$(date +%Y.%m.%d).$CI_COMMIT_SHORT_SHA
|
|
- echo "TAG=$TAG" > variables.env
|
|
artifacts:
|
|
reports:
|
|
dotenv: variables.env
|
|
|
|
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_COMMIT_BRANCH" == "main" ]; 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
|
|
artifacts:
|
|
reports:
|
|
dotenv: build.env
|
|
|
|
"Create release":
|
|
stage: release
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
rules:
|
|
- if: $CI_COMMIT_BRANCH == "main"
|
|
when: always
|
|
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}"
|