mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Generate tarballs in release CI
The `generate_tarball` job vendors all Go modules to make packaging for distributions easier.
This commit is contained in:
parent
01ae5b56e8
commit
e18a4ac147
1 changed files with 37 additions and 0 deletions
|
@ -166,3 +166,40 @@ debian-testing:
|
||||||
<<: *test-template
|
<<: *test-template
|
||||||
script:
|
script:
|
||||||
- *go-test
|
- *go-test
|
||||||
|
|
||||||
|
generate_tarball:
|
||||||
|
stage: deploy
|
||||||
|
image: golang:1.17-stretch
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
script:
|
||||||
|
- go mod vendor
|
||||||
|
- tar czf ${CI_PROJECT_NAME}-${CI_COMMIT_TAG#v}.tar.gz --transform "s,^,${CI_PROJECT_NAME}-${CI_COMMIT_TAG#v}/," *
|
||||||
|
after_script:
|
||||||
|
- echo TAR_JOB_ID=$CI_JOB_ID >> generate_tarball.env
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- ${CI_PROJECT_NAME}-${CI_COMMIT_TAG#v}.tar.gz
|
||||||
|
reports:
|
||||||
|
dotenv: generate_tarball.env
|
||||||
|
|
||||||
|
release-job:
|
||||||
|
stage: deploy
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
needs:
|
||||||
|
- job: generate_tarball
|
||||||
|
artifacts: true
|
||||||
|
script:
|
||||||
|
- echo "running release_job"
|
||||||
|
release:
|
||||||
|
name: 'Release $CI_COMMIT_TAG'
|
||||||
|
description: 'Created using the release-cli'
|
||||||
|
tag_name: '$CI_COMMIT_TAG'
|
||||||
|
ref: '$CI_COMMIT_TAG'
|
||||||
|
assets:
|
||||||
|
links:
|
||||||
|
- name: '${CI_PROJECT_NAME}-${CI_COMMIT_TAG#v}.tar.gz'
|
||||||
|
url: '${CI_PROJECT_URL}/-/jobs/${TAR_JOB_ID}/artifacts/file/${CI_PROJECT_NAME}-${CI_COMMIT_TAG#v}.tar.gz'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue