diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 347ab25..e0a01fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - check - build + - release check: stage: check @@ -8,10 +9,42 @@ check: - 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 tags: - nix script: - 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"