an attempt at automated CI release builds that almost certainly won't work

This commit is contained in:
Lynne Megido 2021-06-18 13:16:14 +10:00
parent 60eb781132
commit 8a91ca3ef4
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
2 changed files with 48 additions and 1 deletions

4
.gitignore vendored
View File

@ -1,6 +1,6 @@
/target /target
/imgs /imgs
fif_* /fif_*
/old /old
/.mypy_cache /.mypy_cache
/__pycache__ /__pycache__
@ -11,3 +11,5 @@ todo.txt
/pkg/* /pkg/*
/out /out
/packages /packages
/fif
/fif.exe

View File

@ -2,6 +2,7 @@ image: "rust:latest"
variables: variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo CARGO_HOME: $CI_PROJECT_DIR/.cargo
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/fif"
cache: cache:
paths: paths:
@ -19,6 +20,7 @@ stages:
- build-base - build-base
- build - build
- test - test
- release
# TEMPLATES # TEMPLATES
@ -173,3 +175,46 @@ test-nightly:
paths: paths:
- target - target
- .cargo - .cargo
build-release:
stage: release
cache: { }
rules:
- if: $CI_COMMIT_TAG
needs: ["test-stable"]
script:
- ./package.sh
artifacts:
paths:
- out/
upload-release:
stage: release
cache: { }
rules:
- if: $CI_COMMIT_TAG
image: curlimages/curl:latest
script:
- git describe --tags --abbrev=0 | cut -c 2- > tmp
- |
cd out
for _bin in *.{zip,xz} do; curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "$_bin" "${PACKAGE_REGISTRY_URL}/$(cat ../tmp)/${_bin}"; done
- rm ../tmp
create-release:
stage: release
cache: {}
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
cd out
echo -n "release-cli create --name \"Release $CI_COMMIT_TAG\" --tag-name=\"$CI_COMMIT_TAG\" " > tmp.sh
git describe --tags --abbrev=0 | cut -c 2- > tmp
for _bin in *.{zip,xz}; do echo -n --assets-link \"\{\"name\":\"${_bin}\",\"url\":\"${PACKAGE_REGISTRY_URL}/$(cat tmp)/${_bin}\"\}\" >> tmp.sh; echo -n " " >> tmp.sh; done
- cat tmp.sh
- bash tmp.sh
- |
rm tmp.sh
rm tmp