stages: - build - release variables: PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/insatller/" build_glibc: stage: build image: rust:bullseye script: - cargo build --release - cp target/release/dotfiles_installer ./installer-amd64-glibc artifacts: paths: - installer-amd64-glibc build_muslc: stage: build image: rust:alpine script: - apk add pkgconf musl-dev - cargo build --release - cp target/release/dotfiles_installer ./installer-amd64-muslc artifacts: paths: - installer-amd64-muslc upload_assets: stage: release image: curlimages/curl:latest needs: - job: build_glibc artifacts: true - job: build_muslc artifacts: true script: - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file installer-amd64-glibc "${PACKAGE_REGISTRY_URL}/dev-$CI_COMMIT_SHORT_SHA/installer-amd64-glibc"' - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file installer-amd64-muslc "${PACKAGE_REGISTRY_URL}/dev-$CI_COMMIT_SHORT_SHA/installer-amd64-muslc"' create_release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest needs: - upload_assets script: - echo "running release_job" release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties tag_name: 'dev-$CI_COMMIT_SHORT_SHA' description: 'Release dev-$CI_COMMIT_SHORT_SHA' assets: links: - name: 'installer-amd64-glibc' url: '${PACKAGE_REGISTRY_URL}/dev-$CI_COMMIT_SHORT_SHA/installer-amd64-glibc' link_type: package - name: 'installer-amd64-muslc' url: '${PACKAGE_REGISTRY_URL}/dev-$CI_COMMIT_SHORT_SHA/installer-amd64-muslc' link_type: package