include: - local: '/backend/.gitlab-ci.yml' - local: '/frontend/.gitlab-ci.yml' stages: - build - package - release .package_server: image: alpine:latest stage: package before_script: - apk update - apk add xz tar artifacts: paths: - '*.tar.xz' package_server_glibc: extends: .package_server needs: - job: build_backend_glibc artifacts: true - job: test_and_build_frontend artifacts: true script: - mkdir static - mv frontend/dist/* static/ - tar -cvJf linux-x64-glibc.tar.xz server static package_server_muslc: extends: .package_server needs: - job: build_backend_muslc artifacts: true - job: test_and_build_frontend artifacts: true script: - mkdir static - mv frontend/dist/* static/ - tar -cvJf linux-x64-muslc.tar.xz server static upload_assets: stage: release image: curlimages/curl:latest needs: - job: package_server_glibc artifacts: true - job: package_server_muslc artifacts: true rules: - if: $CI_COMMIT_TAG script: - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file linux-x64-glibc.tar.xz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-glibc/$CI_COMMIT_TAG/linux-x64-glibc.tar.xz"' - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file linux-x64-muslc.tar.xz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-muslc/$CI_COMMIT_TAG/linux-x64-muslc.tar.xz"' create_release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest needs: - upload_assets rules: - if: $CI_COMMIT_TAG script: - echo "running release_job" release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties tag_name: '$CI_COMMIT_TAG' description: 'Release $CI_COMMIT_TAG' assets: links: - name: 'linux-x64-glibc.tar.xz' url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-glibc/$CI_COMMIT_TAG/linux-x64-glibc.tar.xz' link_type: package - name: 'linux-x64-muslc.tar.xz' url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-muslc/$CI_COMMIT_TAG/linux-x64-muslc.tar.xz' link_type: package