From 3c55e303ffa20e1f26f6827bd265ac87261f55b9 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr> Date: Tue, 18 Jul 2023 11:58:26 +0200 Subject: [PATCH] ci: Comment API and use release. --- .gitlab-ci.yml | 50 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f191a150..9bb95f85 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,21 +3,41 @@ stages: - test - release +######### +# BUILD # +######### + build: stage: build script: - echo "TODO build pamhyr" +# build-lang: +# stage: build +# script: +# - cd ./src/lang/ +# - ./create_ts.sh + +######### +# TESTS # +######### + test: stage: test script: - echo "TODO PAMHYR tests" +############ +# PACKAGES # +############ + linux-package: stage: release + rules: + - if: $CI_COMMIT_BRANCH == 'master' artifacts: paths: - - packages/pamhyr-src.tar.gz + # - packages/pamhyr-src.tar.gz - packages/pamhyr-gnulinux-amd64.tar.xz script: - cd packages @@ -27,16 +47,20 @@ tag-linux-release: stage: release rules: - if: $CI_COMMIT_TAG - needs: - - job: linux-package - artifacts: true + artifacts: + paths: + - packages/pamhyr-gnulinux-amd64.tar.xz script: - - echo "POST ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links" - - echo " url - ${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts" - - | - curl --request POST \ - --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" \ - --data name="pamhyr-gnulinux-amd64-${CI_COMMIT_TAG}" \ - --data url="${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-gnulinux-amd64.tar.xz" \ - --data direct_asset_path="/packages/pamhyr-gnulinux-amd64.tar.xz" \ - "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links" + - cd packages + - ./linux.sh + release: + name: '$CI_COMMIT_TAG-release' + description: 'Automatic release from tag $CI_COMMIT_TAG' + tag_name: '$CI_COMMIT_TAG' + ref: '$CI_COMMIT_SHA' + assets: + links: + - name: 'pamhyr-gnulinux-amd64' + url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-gnulinux-amd64.tar.xz' + filepath: '/packages/pamhyr-gnulinux-amd64.tar.xz' + link_type: 'other' -- GitLab