Skip to content

Commit

Permalink
Merge branch 'dev/0.8' into feat/keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
SirEndii committed Jan 16, 2025
2 parents 1b147a3 + f0e7755 commit 48ce6e5
Show file tree
Hide file tree
Showing 121 changed files with 3,087 additions and 736 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and Test

on:
workflow_dispatch:
push:
pull_request:
types:
- opened
- synchronize

jobs:
generate-artifact-name:
runs-on: self-hosted
outputs:
name: ${{ steps.name.outputs.name }}
steps:
- name: Generate Name
id: name
run: |
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
suffix="PR ${{ github.event.number }}"
else
ref="${{ github.ref }}"
ref="${ref#refs/heads/}"
suffix="${ref//\//-}"
fi
name="AdvancedPeripherals $suffix"
echo "name: $name"
echo "name=$name" >> "$GITHUB_OUTPUT"
build-and-test:
needs:
- generate-artifact-name
uses: IntelligenceModding/actions/.github/workflows/build-and-test.yaml@master
with:
build_name: ${{ needs.generate-artifact-name.outputs.name }}
pr: ${{ github.event_name == 'pull_request' && github.event.number || '' }}
check: ${{ github.event_name != 'push' }}

publish:
if: ${{ github.event_name == 'push' && contains(github.ref, 'release/') }}
runs-on: self-hosted
needs:
- build-and-test
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Download Builds
uses: actions/download-artifact@v4
with:
name: ${{ needs.build-and-test.outputs.artifact-name }}
path: build/libs
- name: Patch Changelog
run: ./gradlew patchChangelog
- name: Github Release
run: ./gradlew githubRelease
- name: Publish Maven
run: ./gradlew publishAllPublicationsToPublicRepository
- name: Publish Modrinth
run: ./gradlew modrinth
- name: Publish CurseForge
run: ./gradlew publishCurseForge
13 changes: 0 additions & 13 deletions .github/workflows/build-and-test.yaml

This file was deleted.

124 changes: 124 additions & 0 deletions .github/workflows/pr-comment-artifacts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# https://github.com/orgs/community/discussions/51403

name: Comment Artifacts

on:
workflow_run:
types:
- "completed"
workflows:
- "Build and Test"

permissions:
actions: read
attestations: read
contents: read
pull-requests: write

jobs:
parse-metadata:
runs-on: ubuntu-latest
outputs:
PR_NUMBER: ${{ steps.metadata.outputs.PR_NUMBER }}
HEAD_SHA: ${{ steps.metadata.outputs.HEAD_SHA }}
ARTIFACT_ID: ${{ steps.metadata.outputs.ARTIFACT_ID }}
ARTIFACT_URL: ${{ steps.metadata.outputs.ARTIFACT_URL }}
ARTIFACT_EXP: ${{ steps.metadata.outputs.ARTIFACT_EXP }}
ARTIFACT_NAME: ${{ steps.metadata.outputs.ARTIFACT_NAME }}
steps:
- name: Get Artifact URL & PR Info
id: metadata
env:
GITHUB_TOKEN: ${{ github.token }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }}
PREVIOUS_JOB_ID: ${{ github.event.workflow_run.id }}
run: |
echo "Previous Job ID: $PREVIOUS_JOB_ID"
LOG_URL="/repos/$OWNER/$REPO/actions/runs/$PREVIOUS_JOB_ID/logs"
echo "Getting previous logs: $LOG_URL"
gh api "$LOG_URL" >_logs.zip
echo "Unzipping logs"
unzip -p _logs.zip >_build.txt
echo "Parsing logs"
function parse_var {
name=$1
echo "Parsing output $name"
line=$(cat _build.txt | grep -m 1 "output:${name}=" | cat)
export parsed=${line#*"output:${name}="}
}
parse_var PR_NUMBER
PR_NUMBER=$parsed
echo "PR Number: $PR_NUMBER"
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_OUTPUT"
parse_var HEAD_SHA
HEAD_SHA=$parsed
echo "Head sha: $HEAD_SHA"
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_OUTPUT"
parse_var ARTIFACT_ID
ARTIFACT_ID=$parsed
echo "ARTIFACT ID: $ARTIFACT_ID"
echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_OUTPUT"
parse_var ARTIFACT_URL
ARTIFACT_URL=$parsed
echo "ARTIFACT URL: $ARTIFACT_URL"
echo "ARTIFACT_URL=$ARTIFACT_URL" >> "$GITHUB_OUTPUT"
if [[ "$ARTIFACT_ID" != "" ]]; then
ARTIFACT_INFO="$(gh api "/repos/$OWNER/$REPO/actions/artifacts/$ARTIFACT_ID")"
ARTIFACT_EXP=$(echo "$ARTIFACT_INFO" | jq -r ".expires_at")
echo "ARTIFACT EXP: $ARTIFACT_EXP"
echo "ARTIFACT_EXP=$ARTIFACT_EXP" >> "$GITHUB_OUTPUT"
ARTIFACT_NAME=$(echo "$ARTIFACT_INFO" | jq -r ".name")
echo "ARTIFACT NAME: $ARTIFACT_NAME"
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
fi
exit 0
comment-success:
if: ${{ needs.parse-metadata.outputs.PR_NUMBER != '' }}
runs-on: ubuntu-latest
needs:
- parse-metadata
steps:
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ needs.parse-metadata.outputs.PR_NUMBER }}
comment-author: 'github-actions[bot]'
body-includes: '## Build Preview'

- name: Update Comment
env:
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}"
HEAD_SHA: ${{ needs.parse-metadata.outputs.HEAD_SHA }}
ARTIFACT_URL: ${{ needs.parse-metadata.outputs.ARTIFACT_URL }}
ARTIFACT_EXP: ${{ needs.parse-metadata.outputs.ARTIFACT_EXP }}
ARTIFACT_NAME: ${{ needs.parse-metadata.outputs.ARTIFACT_NAME }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ needs.parse-metadata.outputs.PR_NUMBER }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |-
## Build Preview
[![badge]](${{ env.JOB_PATH }})
You can find files attached to the below linked Workflow Run URL (Logs).
| Name | Link |
|-----------|-------------------------|
| Commit | ${{ env.HEAD_SHA }} |
| Logs | ${{ env.JOB_PATH }} |
${{ env.ARTIFACT_URL && format('| Jar Files | [{0}]({1}) |', env.ARTIFACT_NAME, env.ARTIFACT_URL) || '' }}
${{ env.ARTIFACT_EXP && format('| Expires At | {0} |', env.ARTIFACT_EXP) || '' }}
[badge]: https://img.shields.io/badge/${{ format('{0}-{1}', github.event.workflow_run.conclusion, github.event.workflow_run.conclusion == 'success' && '3fb950' || 'f85149') }}?style=for-the-badge&logo=github&label=build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build
# other
eclipse
run
runs
server

# Files from Forge MDK
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

For now, just a prototype changelog so I don't need to remember/search everything I did
### Added
- NBT Hashes for filters and item/fluid properties. Lightweight version of the fingerprints, cc also uses nbt hashes for everything nbt related

## [1.19.2-0.7.37r] - 2024-10-06

### Added
- Wandering Trader config

### Changed
- Safe the owner of the memory card to the inventory manager after a player places the card into the manager and clear the card after. Resolves a security issue where players could eventually steal memory cards from other players

### Fixed
- [#660] Fixed that the inventory manager's `getItemInHand` function adds a blank nbt tag to the item
- [#636] Fixed that the automata's `useOnBlock` function will return PASS in some specific case
- [#645] Fixed that the inventory functions for the powah integration would always return nil
- Fixed that some entity operations don't have enough range

## [1.19.2-0.7.36r] - 2024-06-11

### Added
Expand Down
39 changes: 34 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ wrapper {

def isSnapshotVersion = project.hasProperty('teamcityBuild')

version = "${mod_version}" + (isSnapshotVersion ? "-SNAPSHOT" : "")
version = "${mod_version}" + (isSnapshotVersion ? "-SNAPSHOT" : "") + "${mod_artifact_suffix}"
group = 'de.srendi.advancedperipherals'

def static getenv(path = ".env") {
Expand Down Expand Up @@ -246,7 +246,17 @@ repositories {
maven {
url = "https://cursemaven.com"
content {
includeGroup "curse.maven"
includeGroup("curse.maven")
}
}
maven {
url = "https://maven.valkyrienskies.org"
content {
includeGroup("org.valkyrienskies")
includeGroup("org.valkyrienskies.core")
includeGroup("com.github.LlamaLad7")
includeGroup("com.github.Rubydesic")
includeGroup("org.mapstruct")
}
}
}
Expand Down Expand Up @@ -332,16 +342,16 @@ dependencies {
// DimStorage
compileOnly fg.deobf("curse.maven:dimstorage-353882:${dimstorage_version}")
compileOnly fg.deobf("curse.maven:edivadlib-638508:${edivadlib_version}")
runtimeOnly fg.deobf("curse.maven:dimstorage-353882:${dimstorage_version}")
runtimeOnly fg.deobf("curse.maven:edivadlib-638508:${edivadlib_version}")
// runtimeOnly fg.deobf("curse.maven:dimstorage-353882:${dimstorage_version}")
// runtimeOnly fg.deobf("curse.maven:edivadlib-638508:${edivadlib_version}")

//Powah
compileOnly fg.deobf("curse.maven:powah-633483:${powah_version}")
runtimeOnly fg.deobf("curse.maven:powah-633483:${powah_version}")
runtimeOnly fg.deobf("me.shedaniel.cloth:cloth-config-forge:8.2.88")
runtimeOnly fg.deobf("dev.architectury:architectury-forge:6.2.43")

// Crash utilities. Used to debug the chunky turtle. Can be uncommented if not needed
// Crash utilities. Used to debug the chunky turtle. Can be commented if not needed
runtimeOnly fg.deobf("curse.maven:crash-utilities-371813:4406293")

testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_version}"
Expand All @@ -362,6 +372,25 @@ dependencies {
// Create Crafts & Additions
compileOnly fg.deobf("curse.maven:createaddition-439890:5099757")
// runtimeOnly fg.deobf("curse.maven:createaddition-439890:5099757")

// Valkyrien Skies 2
implementation("org.joml:joml:1.10.4") {
transitive = false
}
implementation("org.joml:joml-primitives:1.10.0") {
transitive = false
}
// implementation fg.deobf("org.valkyrienskies:valkyrienskies-119-common:${vs2_version}")
implementation fg.deobf("org.valkyrienskies:valkyrienskies-119-forge:${vs2_version}") {
transitive = false
}
compileOnly "org.valkyrienskies.core:api:${vs_core_version}"
compileOnly "org.valkyrienskies.core:api-game:${vs_core_version}"
compileOnly "org.valkyrienskies.core:util:${vs_core_version}"
compileOnly "org.valkyrienskies.core:impl:${vs_core_version}"
runtimeOnly fg.deobf("curse.maven:valkyrien-skies-258371:${valkyrien_skies_version}")
runtimeOnly fg.deobf("curse.maven:eureka-ships-654384:${eureka_ships_version}")
runtimeOnly fg.deobf("curse.maven:clockwork-807792:${clockwork_version}")
}


Expand Down
4 changes: 3 additions & 1 deletion docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ TOKEN=<github token with access to packages API>
### Release process

- Execute `./gradlew patchChangelog` or manually update `CHANGELOG.md` and commit result to repository
- Run `git tag <minecraft_version>-<version>` to create git tag and push it to repository via `git push --tags`
- ~~Run `git tag <minecraft_version>-<version>` to create git tag and push it to repository via `git push --tags`~~
- Upload project to github via `./gradlew githubRelease`
- Upload project to curseforge via `./gradlew curseforge`
- Upload project to modrinth via `./gradlew publishModrinth`
- Upload project to maven via `./gradlew publishAllPublicationsToPublicRepository`
- Update `mod_version` to next patch or minor version, what you want
11 changes: 10 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ org.gradle.logging.level=info

# Minecraft related
mod_id=advancedperipherals
# do not include mod_version/minecraft_version with equals sign anywhere else in the file (even in comments)
# also do not add space around the equal sign
# since we are using poor grep command to do automation :p
mod_version=0.8r
minecraft_version=1.19.2
mod_artifact_suffix=
forge_version=43.4.0
loader_version=43
mod_version=0.8r
release_type=release
mappings_channel=parchment
mappings_version=2022.11.20-1.19.2
Expand Down Expand Up @@ -37,6 +41,11 @@ ae2additions_version=4646599
kotlinforforge_version=3.12.0
appliedmekanistics_version=4734608
dimstorage_version=3927875
valkyrien_skies_version=4994898
eureka_ships_version=5321628
clockwork_version=5171528
vs2_version=2.1.2-beta.1+a04911c932
vs_core_version=1.1.0+2a62e6a823

# Mod dependencies which are needed for other mods
# For minecolonies
Expand Down
Loading

0 comments on commit 48ce6e5

Please sign in to comment.