1
0
Fork 0
mirror of https://github.com/pnx/pinger.git synced 2026-06-16 03:24:54 +02:00

.gitlab-ci.yml: Upload artifacts as package on tags.

This commit is contained in:
Henrik Hautakoski 2023-03-13 21:50:30 +01:00
parent afd054ff67
commit 39d20366dc

View file

@ -7,13 +7,13 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Go.gitlab-ci.yml
image: golang:latest
stages:
- test
- build
- release
format:
image: golang:latest
stage: test
script:
- go fmt $(go list ./... | grep -v /vendor/)
@ -21,6 +21,7 @@ format:
- go test -race $(go list ./... | grep -v /vendor/)
compile:
image: golang:latest
stage: build
script:
- mkdir -p bin
@ -32,3 +33,14 @@ compile:
paths:
- bin
expire_in: 1 week
upload:
stage: release
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file bin/pinger-32.exe "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${CI_COMMIT_TAG}/pinger-32.exe"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file bin/pinger-x64.exe "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${CI_COMMIT_TAG}/pinger-x64.exe"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file bin/pinger-linux-x86 "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${CI_COMMIT_TAG}/pinger-linux-x86"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file bin/pinger-linux-x64 "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${CI_COMMIT_TAG}/pinger-linux-x64"'