Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
1.19.x/dev (#93)
Browse files Browse the repository at this point in the history
* fix tick of player suffocation on teleport and join game

* actions publish 1

* actions publish 2

* actions publish 3

* actions publish 4

* actions publish 5

* actions publish 5

* actions publish 7

* actions publish 8

* actions publish 9

* actions publish 10

* actions publish 11
  • Loading branch information
Sorenon authored Jul 23, 2022
1 parent 09c5074 commit c31211a
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 67 deletions.
44 changes: 21 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: gradle-ci

name: build
on: [pull_request, push]
on: [ push, pull_request ]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-2022]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- name: checkout repository
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/checkout@v3
- name: setup JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt
- name: update cache
uses: actions/cache@v3
with:
java-version: ${{ matrix.java }}
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew

- name: build
run: ./gradlew build

- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: gradle-ci

on:
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: checkout repository
uses: actions/checkout@v3
- name: setup JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt
- name: update cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: make gradle wrapper executable
run: chmod +x ./gradlew

- name: build
run: ./gradlew build

- if: ${{ contains(github.ref, 'core') }}
name: Upload MCXR-Core artifacts to Modrinth, Curseforge and GitHub
uses: Kir-Antipov/[email protected]
with:
modrinth-id: hcEWWGik
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

curseforge-id: 631772
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

github-token: ${{ secrets.GITHUB_TOKEN }}

files: mcxr-core/build/libs/!(*-@(dev|sources|all)).jar

version-type: beta

loaders: fabric

version-resolver: latest

- if: ${{ contains(github.ref, 'play') }}
name: Upload MCXR-Play artifacts to Modrinth, Curseforge and GitHub
uses: Kir-Antipov/[email protected]
with:
modrinth-id: hcEWWGik
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

curseforge-id: 9jVyqpHR
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

github-token: ${{ secrets.GITHUB_TOKEN }}

files: mcxr-play/build/libs/!(*-@(dev|sources|all)).jar

version-type: beta

loaders: fabric

version-resolver: latest
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.14.6

# Mod Properties
core_version = 0.2.2
play_version = 0.2.2
core_version = 0.3.0
play_version = 0.3.0
maven_group = net.sorenon

# Dependencies
Expand Down
22 changes: 1 addition & 21 deletions mcxr-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ base {
archivesBaseName = "mcxr-core"
}

version = "${properties["core_version"].toString()}+${getVersionMetadata()}"
version = "${properties["core_version"].toString()}+mc${properties["minecraft_version"].toString()}"
group = properties["maven_group"].toString()

repositories {
Expand Down Expand Up @@ -100,23 +100,3 @@ loom {
}
}
}

fun getVersionMetadata(): String {
val buildId = System.getenv("GITHUB_RUN_NUMBER")

// CI builds only
if (buildId != null) {
return "build.${buildId}"
}

val grgit = extensions.getByName("grgit") as org.ajoberstar.grgit.Grgit;
val head = grgit.head()
var id = head.abbreviatedId

// Flag the build if the build tree is not clean
if (!grgit.status().isClean) {
id += "-dirty"
}

return "rev.${id}"
}
22 changes: 1 addition & 21 deletions mcxr-play/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ base {
archivesBaseName = "mcxr-play"
}

version = "${properties["play_version"].toString()}+${getVersionMetadata()}"
version = "${properties["play_version"].toString()}+mc${properties["minecraft_version"].toString()}"
group = properties["maven_group"].toString()

repositories {
Expand Down Expand Up @@ -116,23 +116,3 @@ loom {
}
}
}

fun getVersionMetadata(): String {
val buildId = System.getenv("GITHUB_RUN_NUMBER")

// CI builds only
if (buildId != null) {
return "build.${buildId}"
}

val grgit = extensions.getByName("grgit") as org.ajoberstar.grgit.Grgit;
val head = grgit.head()
var id = head.abbreviatedId

// Flag the build if the build tree is not clean
if (!grgit.status().isClean) {
id += "-dirty"
}

return "rev.${id}"
}

0 comments on commit c31211a

Please sign in to comment.