-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
48 lines (44 loc) · 1.73 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
48 lines (44 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
stages:
- build_and_deploy
build_and_deploy:
stage: build_and_deploy
when: manual
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
image:
name: gitlab.codingame.com:5050/codingame/tools/build-release:master
entrypoint: [""]
variables:
VERSION:
AUTO_RELEASE_NOTES:
MAVEN_OPTS: "-Xms4096M -Xmx4096M -XX:MaxMetaspaceSize=1024M"
script: |
set -ex # fail on 1st error
gpg --import "$PUBLIC_KEYS_FILE"
gpg --import "$PRIVATE_KEYS_FILE"
cat "$TRUST_SETTINGS_FILE"
gpg --import-ownertrust "$TRUST_SETTINGS_FILE"
rm -rf docs
find . -type f -name pom.xml | xargs sed -i "s/master\\-SNAPSHOT/$VERSION/g"
mvn -amd -s ./settings.xml -Dmaven.repo.local=/m2/repository -B -U clean deploy
mvn -s ./settings.xml -Dmaven.repo.local=/m2/repository javadoc:aggregate
rm -rf docs
mkdir docs
cp -R target/site/apidocs/* docs/
git add docs
if [ -z $(git tag -l $VERSION) ]
then
git config --global user.email "$(git show HEAD^2 -s --pretty=format:'%ae')"
git config --global user.name "$(git show HEAD^2 -s --pretty=format:'%an')"
git commit -m "javadoc v$VERSION"
git tag "v$VERSION" -m ""
git push origin "v$VERSION"
git push origin HEAD:$CI_DEFAULT_BRANCH
fi
if $AUTO_RELEASE_NOTES ; then
RELEASE_NOTES=$(.gitlab/extract_release_notes.js playground/misc/misc-3-release-notes.md $VERSION)
DATA=$(jq -n --arg body "$RELEASE_NOTES" --arg version "v$VERSION" '{body:$body, tag_name:$version, name:$version, draft:true}')
curl -i -H "Authorization: token $GITHUB_TOKEN" \
-d "$DATA" https://api.github.com/repos/CodinGame/codingame-game-engine/releases
fi