From a09d90559864e80d84ef2d725f59e05c2ace15c6 Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Wed, 21 Feb 2024 10:48:27 -0800 Subject: [PATCH] update release ci --- .gitlab-ci.yml | 64 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a5be6d..93222ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,11 @@ default: image: rust:latest +stages: + - build + - test + - release + compile-with-posix-features: stage: build script: @@ -15,31 +20,7 @@ compile-implicit-load: stage: build script: - cargo build -F implicit-load - -compile-release: - stage: build - script: - - cargo build -F implicit-load --release - artifacts: - paths: - - target/release/flesh - - Readme.org - - Writing.org - - Shell.org - - snippets/flesh-mode.el - - snippets/genbind.f - - snippets/interactive-devel.f - - snippets/userlib.f - - LICENSE.md - - snippets/artifacts/default_fleshrc.f - - snippets/artifacts/release_contents.txt - - snippets/artifacts/install.sh - only: - variables: - - $CI_COMMIT_TAG =~ /^v\d+.\d+.\d+-?.*$/ - except: - - branches - + unit-tests: stage: test script: @@ -49,3 +30,36 @@ userlib-tests: stage: test script: - cargo run --no-default-features snippets/userlib.f snippets/userlib-tests.f + +prepare-release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + script: + - cargo build -F implicit-load --release + - | + tar -czf flesh-$CI_COMMIT_TAG.tar.gz \ + target/release/flesh \ + Readme.org Writing.org Shell.org \ + snippets/flesh-mode.el \ + snippets/genbind.f \ + snippets/interactive-devel.f \ + snippets/userlib.f \ + LICENSE.md \ + snippets/release/default_fleshrc.f \ + snippets/release/release_contents.txt \ + snippets/release/install.sh + - echo $CI_COMMIT_TAG > VERSION + - echo $CI_JOB_ID > ID + artifacts: + paths: + - flesh-$CI_COMMIT_TAG.tar.gz + rules: + - if: '$CI_COMMIT_TAG =~ "/^v\d+.\d+.\d+/"' + release: + name: 'Release v$(cat VERSION)' + description: 'See releast_contents.txt' + tag_name: $CI_COMMIT_TAG + assets: + links: + - name: Get the release here + - url: https://gitlab.com/whom/relish/-/jobs/`cat ID`/artifacts/file/flesh-`cat VERSION`.tar.gz