Try to auto-release builds

This commit is contained in:
Greg Hellings
2024-11-15 10:11:41 -06:00
parent dc7ec67f2f
commit 625bceb7a5
+33
View File
@@ -1,6 +1,7 @@
stages: stages:
- check - check
- build - build
- release
check: check:
stage: check stage: check
@@ -8,10 +9,42 @@ check:
- nix - nix
script: script:
- nix flake check - nix flake check
- TAG=$(date +%Y.%m.%d).$CI_COMMIT_SHORT_SHA
- echo "TAG=$TAG" > variables.env
artifacts:
reports:
dotenv: variables.env
build: build:
stage: build stage: build
needs:
- job: check
artifacts: true
tags: tags:
- nix - nix
script: script:
- nom build - nom build
- cp result/sword.tar.xz ./sword-$TAG.tar.xz
- echo "BUILD_ID=$CI_JOB_ID" > build.env
artifacts:
paths:
- sword-$TAG.tar.xz
reports:
dotenv: build.env
expire_in: never
"Create release":
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: check
artifacts: true
- job: build
artifacts: true
script: echo "Tagging as released"
release:
name: Release $TAG
tag_name: '$TAG'
assets-link:
- name: Windows (x86-64) release
url: "https://src.thehellings.com/greg/mingw-nix-build/-/jobs/$BUILD_ID/artifacts/file/sword-$TAG.tar.xz"