Attempt to implement CI

This commit is contained in:
Johannes Frohnmeyer 2022-10-28 16:36:18 +02:00
parent 0ad54e978e
commit a31a1abc6c
Signed by: Johannes
GPG Key ID: E76429612C2929F4
4 changed files with 106 additions and 102 deletions

View File

@ -1,94 +0,0 @@
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
default:
image: gradle:jdk18
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- export TIMESTAMP=$(date -d "$CI_PIPELINE_CREATED_AT" +%s)
build_test:
stage: build
script:
- 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 :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=linux -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP
- gradle --build-cache build :launcher-dist:publish -Pflavor=macos -Pdist.platformOnly -Ppublic -Ptimestamp=$TIMESTAMP
only:
- 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:
stage: deploy
image: archlinux:latest
script:
- pacman -Sy p7zip curl jq --noconfirm
- mkdir -p portable/jvm
- cp wrapper.jar portable/
- curl -L "https://github.com/pal1000/mesa-dist-win/releases/download/21.2.5/mesa3d-21.2.5-release-msvc.7z" --output mesa.7z
- 7z e mesa.7z -oportable/run/natives/forceload x64/dxil.dll x64/libglapi.dll x64/opengl32.dll
- curl -L "https://api.adoptium.net/v3/binary/latest/18/ga/windows/x64/jre/hotspot/normal/eclipse?project=jdk" --output jvm.zip
- 7z x jvm.zip -oportable/
- mv portable/jdk*/* portable/jvm/
- rm -r portable/jdk*
- cp packaging/windows/launch.bat portable/
- cd portable
- 7z a ../portable.7z * -mx9
artifacts:
paths:
- portable.7z
expire_in: 2 days
only:
- master
include:
- remote: 'https://jfmods.gitlab.io/scripts/docs.yml'

100
.woodpecker.yml Normal file
View File

@ -0,0 +1,100 @@
include: https://jfmods.gitlab.io/scripts/docs.yml
pipeline:
export_metadata:
image: gradle:alpine
pull: true
environment:
- GRADLE_OPTS=-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G
- GRADLE_USER_HOME=${CI_WORKSPACE}/.gradle
commands:
- mkdir public
- gradle --build-cache :exportMetadata -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- mv version.json public/
build_platform_jars:
image: gradle:alpine
pull: true
environment:
- GRADLE_OPTS=-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G
- GRADLE_USER_HOME=${CI_WORKSPACE}/.gradle
commands:
- gradle --build-cache :launcher-dist:build -Pflavor=fat -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- gradle --build-cache :launcher-dist:build -Pflavor=windows -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- gradle --build-cache :launcher-dist:build -Pflavor=linux -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- gradle --build-cache :launcher-dist:build -Pflavor=macos -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- for f in launcher-dist/build/libs/Inceptum-*-*-*.jar; do mv "$f" "public/Inceptum-${f##*-}";done
- mv public/Inceptum-fat.jar public/Inceptum.jar
build_wrapper:
image: gradle:alpine
pull: true
environment:
- GRADLE_OPTS=-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G
- GRADLE_USER_HOME=${CI_WORKSPACE}/.gradle
commands:
- gradle --build-cache :wrapper:build -Pflavor=windows -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- cp wrapper/build/libs/*.exe public/wrapper.exe
- cp wrapper/build/libs/*-all.jar public/wrapper.jar
publish_debug:
image: gradle:alpine
pull: true
environment:
- GRADLE_OPTS=-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G
- GRADLE_USER_HOME=${CI_WORKSPACE}/.gradle
commands:
- gradle --build-cache build publish -Pflavor=maven -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- gradle --build-cache build :launcher-dist:publish -Pflavor=fat -Pdist.platformOnly -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- gradle --build-cache build :launcher-dist:publish -Pflavor=windows -Pdist.platformOnly -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- gradle --build-cache build :launcher-dist:publish -Pflavor=linux -Pdist.platformOnly -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
- gradle --build-cache build :launcher-dist:publish -Pflavor=macos -Pdist.platformOnly -Ppublic -Ptimestamp=${CI_PIPELINE_STARTED}
secrets: [ maven_token ]
when:
- branch: master
publish_release:
image: gradle:alpine
pull: true
environment:
- GRADLE_OPTS=-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=-Xmx2G
- GRADLE_USER_HOME=${CI_WORKSPACE}/.gradle
commands:
- 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
secrets: [ maven_token ]
when:
- event: tag
branch: master
portable:
image: archlinux:latest
pull: true
commands:
- pacman -Sy p7zip curl jq --noconfirm
- mkdir -p portable/jvm
- cp wrapper.jar portable/
- curl -L "https://github.com/pal1000/mesa-dist-win/releases/download/21.2.5/mesa3d-21.2.5-release-msvc.7z" --output mesa.7z
- 7z e mesa.7z -oportable/run/natives/forceload x64/dxil.dll x64/libglapi.dll x64/opengl32.dll
- curl -L "https://api.adoptium.net/v3/binary/latest/18/ga/windows/x64/jre/hotspot/normal/eclipse?project=jdk" --output jvm.zip
- 7z x jvm.zip -oportable/
- mv portable/jdk*/* portable/jvm/
- rm -r portable/jdk*
- cp packaging/windows/launch.bat portable/
- cd portable
- 7z a ../public/portable.7z * -mx9
when:
- branch: master
publish:
image: woodpeckerci/plugin-s3
settings:
bucket: pages
region: nebula
path_style: true
endpoint: https://s3.frohnmeyer-wds.de
access_key: pages
secret_key:
from_secret: pages_secret
source: public/**/*
target: /${CI_REPO}
strip_prefix: public/
when:
- branch: master

View File

@ -5,9 +5,7 @@ plugins {
repositories {
mavenCentral()
maven {
setUrl("https://gitlab.com/api/v4/projects/35745143/packages/maven")
}
maven("https://maven.frohnmeyer-wds.de/artifacts")
}
dependencies {
@ -18,12 +16,12 @@ publishing {
repositories {
if (rootProject.extra["isPublic"] == true) {
maven {
url = uri("https://gitlab.com/api/v4/projects/30862253/packages/maven")
name = "gitlab"
url = uri("https://git.frohnmeyer-wds.de/api/packages/JfMods/maven")
name = "gitea"
credentials(HttpHeaderCredentials::class) {
name = "Job-Token"
value = System.getenv()["CI_JOB_TOKEN"]
name = "Authorization"
value = System.getenv()["MAVEN_TOKEN"]
}
authentication {
create<HttpHeaderAuthentication>("header")

@ -1 +1 @@
Subproject commit c93246e29670814079791a5ebe0e62a824cd52e9
Subproject commit 02d86b7a822c3532012f0b9e2ae4506112427877