2021-12-03 08:57:22 -06:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- build
|
2021-12-13 21:50:14 -06:00
|
|
|
- upload
|
|
|
|
- release
|
2021-12-03 08:57:22 -06:00
|
|
|
|
2021-12-03 08:43:04 -06:00
|
|
|
test:cargo:
|
|
|
|
image: rust:latest
|
2021-12-03 08:57:22 -06:00
|
|
|
stage: test
|
2021-12-03 08:43:04 -06:00
|
|
|
script:
|
|
|
|
- rustc --version && cargo --version # Print version info for debugging
|
|
|
|
- rustup component add clippy
|
2021-12-13 14:23:51 -06:00
|
|
|
- cargo clippy --all-targets --all-features -- -D warnings
|
2021-12-03 08:43:04 -06:00
|
|
|
- cargo test
|
2021-07-16 18:00:08 -05:00
|
|
|
|
2021-12-03 09:43:43 -06:00
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
image: categulario/rust-cli-image:latest
|
|
|
|
script:
|
|
|
|
# build the binary
|
|
|
|
- cargo build --locked --release
|
|
|
|
# create the tar package
|
|
|
|
- mkdir -p build
|
|
|
|
# move things to the build directory
|
2021-12-03 09:59:49 -06:00
|
|
|
- cp target/release/t build/t
|
2021-12-03 09:43:43 -06:00
|
|
|
- cp CHANGELOG.md build/CHANGELOG.md
|
|
|
|
- cp README.md build/README.md
|
|
|
|
- cp LICENSE build/LICENSE
|
|
|
|
# compress the tar file
|
2021-12-03 09:59:49 -06:00
|
|
|
- tar -cvzf tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz build/
|
2021-12-03 09:43:43 -06:00
|
|
|
# makes the debian archive
|
|
|
|
- ./debpackage.sh
|
|
|
|
# computes the sums
|
2021-12-03 09:59:49 -06:00
|
|
|
- sha256sum tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz > tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum
|
|
|
|
- sha256sum debian-package/tiempo_${CI_COMMIT_TAG:1}_amd64.deb > tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum
|
2021-12-03 09:43:43 -06:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-12-03 09:59:49 -06:00
|
|
|
- tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz
|
|
|
|
- debian-package/tiempo_${CI_COMMIT_TAG:1}_amd64.deb
|
|
|
|
- tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum
|
|
|
|
- tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum
|
2021-12-03 09:43:43 -06:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH
|
|
|
|
when: never
|
|
|
|
- if: $CI_COMMIT_TAG =~ /^v*/
|
|
|
|
|
2021-12-13 23:12:51 -06:00
|
|
|
variables:
|
|
|
|
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_COMMIT_TAG}/${CI_COMMIT_TAG}"
|
2021-12-13 21:50:14 -06:00
|
|
|
|
2021-12-03 09:43:43 -06:00
|
|
|
upload:
|
2021-12-13 21:50:14 -06:00
|
|
|
stage: upload
|
|
|
|
image: curlimages/curl:latest
|
2021-12-03 09:43:43 -06:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH
|
|
|
|
when: never
|
|
|
|
- if: $CI_COMMIT_TAG =~ /^v*/
|
|
|
|
script:
|
2021-12-13 22:08:20 -06:00
|
|
|
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz ${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz'
|
|
|
|
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum ${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum'
|
|
|
|
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file debian-package/tiempo_${CI_COMMIT_TAG:1}_amd64.deb ${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG:1}_amd64.deb'
|
2021-12-13 22:45:38 -06:00
|
|
|
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum ${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum'
|
2021-12-03 09:43:43 -06:00
|
|
|
|
2021-12-13 22:08:20 -06:00
|
|
|
release:
|
2021-12-13 21:50:14 -06:00
|
|
|
stage: release
|
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
2021-12-03 09:43:43 -06:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH
|
|
|
|
when: never
|
|
|
|
- if: $CI_COMMIT_TAG =~ /^v*/
|
2021-12-02 20:47:10 -06:00
|
|
|
script:
|
2021-12-13 21:50:14 -06:00
|
|
|
- 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'
|
2021-12-13 22:49:29 -06:00
|
|
|
assets:
|
|
|
|
links:
|
|
|
|
- name: 'Any linux binary'
|
|
|
|
url: '${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz'
|
|
|
|
- name: 'Any linux binary sha256 sum'
|
|
|
|
url: '${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum'
|
|
|
|
- name: 'Debian archive'
|
|
|
|
url: '${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG:1}_amd64.deb'
|
|
|
|
- name: 'Debian archive sha256 sum'
|
|
|
|
url: '${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum'
|
2021-12-13 21:50:14 -06:00
|
|
|
|
|
|
|
# deploy:arch-bin:
|
|
|
|
# stage: deploy
|
|
|
|
# image: categulario/makepkg
|
|
|
|
# script:
|
|
|
|
# # setup ssh
|
|
|
|
# - mkdir -p ~/.ssh
|
|
|
|
# - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
|
|
|
# - eval $(ssh-agent -s)
|
|
|
|
# - ssh-add <(echo "$ARCH_PRIVATE_KEY")
|
|
|
|
# # setup git, because we'll commit
|
|
|
|
# - git config --global user.name "$COMMITER_NAME"
|
|
|
|
# - git config --global user.email "$COMMITER_EMAIL"
|
|
|
|
# # finally run the script
|
|
|
|
# - scripts/release-aur-bin.sh
|
|
|
|
# rules:
|
|
|
|
# - if: $CI_COMMIT_BRANCH
|
|
|
|
# when: never
|
|
|
|
# - if: $CI_COMMIT_TAG =~ /^v*/
|
|
|
|
|
|
|
|
# deploy:arch-git:
|
|
|
|
# stage: deploy
|
|
|
|
# image: categulario/makepkg
|
|
|
|
# script:
|
|
|
|
# # setup ssh
|
|
|
|
# - mkdir -p ~/.ssh
|
|
|
|
# - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
|
|
|
# - eval $(ssh-agent -s)
|
|
|
|
# - ssh-add <(echo "$ARCH_PRIVATE_KEY")
|
|
|
|
# # setup git, because we'll commit
|
|
|
|
# - git config --global user.name "$COMMITER_NAME"
|
|
|
|
# - git config --global user.email "$COMMITER_EMAIL"
|
|
|
|
# # finally run the script
|
|
|
|
# - scripts/release-aur-git.sh
|
|
|
|
# rules:
|
|
|
|
# - if: $CI_COMMIT_BRANCH
|
|
|
|
# when: never
|
|
|
|
# - if: $CI_COMMIT_TAG =~ /^v*/
|
|
|
|
|
|
|
|
# pages:
|
|
|
|
# image: python:3.8-alpine
|
|
|
|
# stage: deploy
|
|
|
|
# script:
|
|
|
|
# - pip install -U sphinx
|
|
|
|
# - mkdir -p public/{es,en}
|
|
|
|
# - sphinx-build -b html ./docs/es/source/ public/es
|
|
|
|
# - sphinx-build -b html ./docs/en/source/ public/en
|
|
|
|
# artifacts:
|
|
|
|
# paths:
|
|
|
|
# - public
|
|
|
|
# rules:
|
|
|
|
# - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|