speedup ci & fix release task

This commit is contained in:
jem 2022-02-01 09:17:07 +01:00
parent f2aebb5117
commit 58b5506574

View file

@ -5,7 +5,6 @@ stages:
- test
- package
- publish
- release
before_script:
- echo "---------- Start CI ----------"
@ -32,8 +31,6 @@ build:
test:
stage: test
rules:
- if: $CI_COMMIT_TAG == null # don't run for git tags
image: docker:latest
services:
- docker:dind
@ -49,7 +46,7 @@ test:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker run --privileged -dit --name provs_test -v /var/run/docker.sock:/var/run/docker.sock $CI_REGISTRY_IMAGE
- docker inspect -f '{{.State.Running}}' provs_test
- ./gradlew test -Dtestdockerwithoutsudo=true -DexcludeTags=containertest
- ./gradlew -x assemble test -Dtestdockerwithoutsudo=true -DexcludeTags=containertest
artifacts:
when: on_failure
paths:
@ -58,13 +55,11 @@ test:
junit: build/test-results/test/TEST-*.xml
publish:
publish-snapshot:
stage: publish
rules:
- if: $CI_COMMIT_TAG == null # don't run for git tags
script:
- ./gradlew jar
- ./gradlew publish
- ./gradlew -x assemble -x test jar
- ./gradlew -x assemble -x test publish
artifacts:
paths:
- build/libs/*.jar
@ -105,8 +100,8 @@ uberjarjar:
when: never
- if: $CI_COMMIT_TAG =~ /^release-[0-9]+[.][0-9]+([.][0-9]+)?$/
script:
- ./gradlew uberjarServer
- ./gradlew uberjarDesktop
- ./gradlew -x assemble -x test -x jar uberjarServer
- ./gradlew -x assemble -x test -x jar uberjarDesktop
- cd build/libs/
- find . -type f -exec sha256sum {} \; | sort > sha256sum.lst
- find . -type f -exec sha512sum {} \; | sort > sha512sum.lst
@ -121,7 +116,7 @@ uberjarjar:
release:
image: registry.gitlab.com/gitlab-org/release-cli:latest
stage: release
stage: publish
rules:
- if: $CI_PIPELINE_SOURCE != "push"
when: never
@ -138,7 +133,6 @@ release:
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"provs-desktop.jar\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${CI_JOB_ID}/artifacts/file/build/libs/provs-desktop.jar\"}" \
--assets-link "{\"name\":\"provs-server.jar\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${CI_JOB_ID}/artifacts/file/build/libs/provs-server.jar\"}" \
--assets-link "{\"name\":\"provs-desktop.jar\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${CI_JOB_ID}/artifacts/file/build/libs/provs-desktop.jar\"}" \
--assets-link "{\"name\":\"sha256sum.lst\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${CI_JOB_ID}/artifacts/file/build/libs/sha256sum.lst\"}" \
--assets-link "{\"name\":\"sha512sum.lst\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${CI_JOB_ID}/artifacts/file/build/libs/sha512sum.lst\"}" \