From 8f97fb1e7ebae2c59db28250ba656e8ed5956ab5 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Tue, 10 Mar 2026 08:00:17 +0300 Subject: Add release creation to GitLab CI --- .gitlab-ci.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e36b39..9778cfc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - check - test + - build - release variables: @@ -35,11 +36,11 @@ test: - branches - tags -release: - stage: release +build: + stage: build needs: - test - # Only run on tags starting with "v". + # Run only for semver-like tags "vX.Y.Z". rules: - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' when: on_success @@ -86,3 +87,29 @@ release: paths: - dist/ expire_in: 1 week + +release: + stage: release + needs: + - job: build + artifacts: true + image: registry.gitlab.com/gitlab-org/cli:latest + # Run only for semver-like tags "vX.Y.Z". + rules: + - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' + when: on_success + - when: never + script: + # Visual inspection for debugging. + - ls -lh dist/ + # Authenticate glab using CLI tokens. + - glab auth login --job-token $CI_JOB_TOKEN + # Create (or update) the Release for this tag. + - glab release create "$CI_COMMIT_TAG" + --name "oreilly-epub $CI_COMMIT_TAG" + --notes "Automated release for $CI_COMMIT_TAG" + --use-package-registry + "dist/oreilly-epub-linux-x86_64#Linux x86_64#package" + "dist/oreilly-epub-linux-x86_64-musl#Linux x86_64 (musl)#package" + "dist/oreilly-epub-linux-aarch64#Linux ARM64#package" + "dist/oreilly-epub-linux-aarch64-musl#Linux ARM64 (musl)#package" -- cgit v1.2.3-70-g09d2