Skip to content

Commit

Permalink
CI Build & Publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexeption committed Jun 20, 2022
1 parent fe226f4 commit 4504f73
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 12 deletions.
60 changes: 60 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
image: openjdk:17-jdk

stages:
- setup
- build
- publish
- release

before_script:
- GRADLE_USER_HOME="$(pwd)/.gradle"
- export GRADLE_USER_HOME

cache:
paths:
- .gradle/wrapper
- .gradle/caches
- build/*
- projects/*

setup:
stage: setup
script:
- chmod +x gradlew && ./gradlew setup
except:
- tags

build:
stage: build
script:
- chmod +x gradlew && ./gradlew installerJar
- echo "VERSION=$(./gradlew -q | grep 'Forge Version:' | awk '{print $3}')" >> variables.env
artifacts:
reports:
dotenv: variables.env
paths:
- projects/magma/build/libs/*installer*.jar
except:
- tags

publish:
stage: publish
script:
- chmod +x gradlew && ./gradlew publish
only:
- "1.18.x"
except:
- tags

release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- release-cli --server-url https://git.magmafoundation.org --job-token=$CI_JOB_TOKEN create --name "Magma $VERSION" --description "Magma Release" --tag-name "$CI_COMMIT_SHORT_SHA" --ref "$CI_COMMIT_SHORT_SHA" --assets-link "{\"url\":\"https://git.magmafoundation.org/api/v4/projects/5/packages/maven/org/magmafoundation/Magma/$VERSION/Magma-$VERSION-installer.jar\",\"name\":\"Magma-$VERSION-installer.jar\"}"
only:
- "1.18.x"
except:
- tags

after_script:
- echo "End CI"
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,6 @@ project(':forge') {
MANIFESTS = [
'/': [
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'GitCommit': gradleutils.gitInfo.abbreviatedId,
'Git-Branch': gradleutils.gitInfo.branch,
'FML-System-Mods': 'forge'
] as LinkedHashMap,
'net/minecraftforge/versions/forge/': [
Expand Down
2 changes: 0 additions & 2 deletions fmlcore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ ext {
'': [
'FMLModType': 'LIBRARY',
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Git-Commit': GIT_INFO.abbreviatedId,
'Git-Branch': GIT_INFO.branch,
'Build-Number': "${System.getenv('BUILD_NUMBER')?:0}"
] as LinkedHashMap,
'net/minecraftforge/fml/loading/': [
Expand Down
2 changes: 0 additions & 2 deletions fmlloader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ ext {
MANIFESTS = [
'/': [
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Git-Commit': GIT_INFO.abbreviatedId,
'Git-Branch': GIT_INFO.branch,
'Build-Number': "${System.getenv('BUILD_NUMBER')?:0}",
] as LinkedHashMap,
'net/minecraftforge/fml/loading/': [
Expand Down
2 changes: 0 additions & 2 deletions javafmllanguage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ ext {
'': [
'FMLModType': 'LANGPROVIDER',
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Git-Commit': GIT_INFO.abbreviatedId,
'Git-Branch': GIT_INFO.branch,
'Build-Number': "${System.getenv('BUILD_NUMBER')?:0}",
] as LinkedHashMap,
'net/minecraftforge/fml/loading/': [
Expand Down
2 changes: 0 additions & 2 deletions lowcodelanguage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ ext {
'': [
'FMLModType': 'LANGPROVIDER',
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Git-Commit': GIT_INFO.abbreviatedId,
'Git-Branch': GIT_INFO.branch,
'Build-Number': "${System.getenv('BUILD_NUMBER')?:0}",
] as LinkedHashMap,
'net/minecraftforge/fml/loading/': [
Expand Down
2 changes: 0 additions & 2 deletions mclanguage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ ext {
'': [
'FMLModType': 'LANGPROVIDER',
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Git-Commit': GIT_INFO.abbreviatedId,
'Git-Branch': GIT_INFO.branch,
'Build-Number': "${System.getenv('BUILD_NUMBER')?:0}",
] as LinkedHashMap,
'net/minecraftforge/fml/mclanguageprovider/': [
Expand Down

0 comments on commit 4504f73

Please sign in to comment.