Rework CI script

This commit is contained in:
Johannes Frohnmeyer 2022-09-06 15:49:19 +02:00
parent 81f9cd270a
commit 1f9f56d413
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 63 additions and 46 deletions

View File

@ -1,48 +1,78 @@
image: gradle:jdk18
variables: variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false" GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
stages: stages:
- build - build
- portable
- deploy - deploy
default:
image: gradle:jdk18
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- export TIMESTAMP=$(date -d "$CI_PIPELINE_CREATED_AT" +%s)
build_test: build_test:
stage: build stage: build
script: script:
- TIMESTAMP=$(date +%s) - gradle --build-cache :exportMetadata -Ppublic -Ptimestamp=$TIMESTAMP
artifacts:
paths:
- version.json
expire_in: 2 days
build_platform_jars:
stage: build
script:
- gradle --build-cache :launcher-dist:build -Pflavor=fat -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache :launcher-dist:build -Pflavor=windows -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache :launcher-dist:build -Pflavor=linux -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache :launcher-dist:build -Pflavor=macos -Ppublic -Ptimestamp=$TIMESTAMP
- for f in launcher-dist/build/libs/Inceptum-*-*-*.jar; do mv "$f" "Inceptum-${f##*-}";done
- mv Inceptum-fat.jar Inceptum.jar
artifacts:
paths:
- launcher-dist/build/libs
- Inceptum-*.jar
- Inceptum.jar
expire_in: 2 days
build_wrapper:
stage: build
script:
- gradle --build-cache :wrapper:build -Pflavor=windows -Ppublic -Ptimestamp=$TIMESTAMP
- cp wrapper/build/libs/*.exe wrapper.exe
- cp wrapper/build/libs/*-all.jar wrapper.jar
artifacts:
paths:
- wrapper/build/libs
- wrapper.jar
- wrapper.exe
expire_in: 2 days
publish_debug:
stage: deploy
script:
- gradle --build-cache build publish -Pflavor=maven -Ppublic -Ptimestamp=$TIMESTAMP - gradle --build-cache build publish -Pflavor=maven -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache build :launcher-dist:publish -Pflavor=fat -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP - gradle --build-cache build :launcher-dist:publish -Pflavor=fat -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache build :launcher-dist:publish -Pflavor=windows -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP - gradle --build-cache build :launcher-dist:publish -Pflavor=windows -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache build :launcher-dist:publish -Pflavor=linux -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP - gradle --build-cache build :launcher-dist:publish -Pflavor=linux -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache build :launcher-dist:publish -Pflavor=macos -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP - gradle --build-cache build :launcher-dist:publish -Pflavor=macos -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache :exportMetadata -Ppublic -Ptimestamp=$TIMESTAMP
- mkdir -p build/libs
- cp launcher-dist/build/libs/* build/libs/
- cp wrapper/build/libs/* build/libs/
- cp launcher-dist/build/libs/*-*-*-*.jar ./
- cp wrapper/build/libs/*.exe wrapper.exe
- cp wrapper/build/libs/*-all.jar wrapper.jar
- for f in *-*-*.jar; do mv "$f" "latest-${f##*-}";done
- mv latest-fat.jar latest.jar
artifacts:
paths:
- build/libs
- latest.jar
- wrapper.jar
- wrapper.exe
- latest-*.jar
- version.json
expire_in: 2 days
only: only:
- master - master
publish_release:
rules:
- if: $CI_COMMIT_TAG && '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^master/'
stage: deploy
script:
- gradle --build-cache build publish -Pflavor=maven -Ppublic -Prelease
- gradle --build-cache build :launcher-dist:publish -Pflavor=fat -Pdist.platformOnly -Ppublic -Prelease
- gradle --build-cache build :launcher-dist:publish -Pflavor=windows -Pdist.platformOnly -Ppublic -Prelease
- gradle --build-cache build :launcher-dist:publish -Pflavor=linux -Pdist.platformOnly -Ppublic -Prelease
- gradle --build-cache build :launcher-dist:publish -Pflavor=macos -Pdist.platformOnly -Ppublic -Prelease
portable: portable:
stage: portable stage: deploy
image: archlinux:latest image: archlinux:latest
script: script:
- pacman -Sy p7zip curl jq --noconfirm - pacman -Sy p7zip curl jq --noconfirm
@ -70,17 +100,6 @@ portable:
only: only:
- master - master
deploy:
rules:
- if: $CI_COMMIT_TAG && '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^master/'
stage: deploy
script:
- gradle --build-cache build publish -Pflavor=maven -Ppublic -Prelease
- gradle --build-cache build :launcher-dist:publish -Pflavor=fat -Pdist.platformOnly -Ppublic -Prelease
- gradle --build-cache build :launcher-dist:publish -Pflavor=windows -Pdist.platformOnly -Ppublic -Prelease
- gradle --build-cache build :launcher-dist:publish -Pflavor=linux -Pdist.platformOnly -Ppublic -Prelease
- gradle --build-cache build :launcher-dist:publish -Pflavor=macos -Pdist.platformOnly -Ppublic -Prelease
pages: pages:
image: python:3.8-buster image: python:3.8-buster
stage: deploy stage: deploy

View File

@ -6,14 +6,12 @@ Inceptum can be installed in a number of ways, all of which are documented below
First, download the Inceptum build appropriate for your system: First, download the Inceptum build appropriate for your system:
- [Windows x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-windows.jar?job=build_test) - [Windows x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/Inceptum-windows.jar?job=build_platform_jars)
- [MacOS x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-macos.jar?job=build_test) (untested) - [MacOS x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/Inceptum-macos.jar?job=build_platform_jars) (untested)
- [Linux x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-linux.jar?job=build_test) - [Linux x86_64](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/Inceptum-linux.jar?job=build_platform_jars)
The following additional builds are also available but not recommended for normal use: You can also download a [single jar](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/Inceptum.jar?job=build_platform_jars)
that contains support for all of these systems (though doing so is not recommended)
- [Windows/Mac/Linux x86_64 in one](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest.jar?job=build_test)
- [Headless](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/latest-nogui.jar?job=build_test)
Once you have a jar, run it with an [up-to-date java version](https://adoptium.net/). Once you have a jar, run it with an [up-to-date java version](https://adoptium.net/).
Inceptum will use your config directory ($XDG_CONFIG_HOME, ~/.config/Inceptum, %APPDATA%\Inceptum or ~/Library/Application Support/Inceptum) for saving instances/caches/etc. Inceptum will use your config directory ($XDG_CONFIG_HOME, ~/.config/Inceptum, %APPDATA%\Inceptum or ~/Library/Application Support/Inceptum) for saving instances/caches/etc.
@ -34,10 +32,10 @@ If this parameter is specified, all other locations will be ignored.
## Simple installation with updates ## Simple installation with updates
To use automatic updates, you must use the Inceptum Wrapper. To use automatic updates, you must use the Inceptum Wrapper.
Simply launch this [cross-platform jar](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/wrapper.jar?job=build_test) Simply launch this [cross-platform jar](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/wrapper.jar?job=build_wrapper)
and Inceptum will launch as described above (though the initial startup may take a bit longer). The same rules for config locations apply. and Inceptum will launch as described above (though the initial startup may take a bit longer). The same rules for config locations apply.
You may also download the [windows exe](https://gitlab.com/jfmods/inceptum/-/jobs/artifacts/master/raw/wrapper.exe?job=build_test) You may also download the [windows exe](https://gitlab.com/jfmods/inceptum/-/jobs/artifacts/master/raw/wrapper.exe?job=build_wrapper)
which uses fabric-installer-native-bootstrap to locate the JVM used by the official minecraft launcher and launch Inceptum using that. which uses fabric-installer-native-bootstrap to locate the JVM used by the official minecraft launcher and launch Inceptum using that.
Please be aware that this is pretty much untested Please be aware that this is pretty much untested