Skip to content

Commit a1777b0

Browse files
authored
Merge pull request #679 from IntelligenceModding/dev/1.21.1
Port to 1.21.1
2 parents 3dd955b + e9adb24 commit a1777b0

288 files changed

Lines changed: 2607 additions & 2072 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and Test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
types:
8+
- opened
9+
- synchronize
10+
11+
jobs:
12+
generate-artifact-name:
13+
runs-on: self-hosted
14+
outputs:
15+
name: ${{ steps.name.outputs.name }}
16+
steps:
17+
- name: Generate Name
18+
id: name
19+
run: |
20+
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
21+
suffix="PR ${{ github.event.number }}"
22+
else
23+
ref="${{ github.ref }}"
24+
ref="${ref#refs/heads/}"
25+
suffix="${ref//\//-}"
26+
fi
27+
name="AdvancedPeripherals $suffix"
28+
echo "name: $name"
29+
echo "name=$name" >> "$GITHUB_OUTPUT"
30+
31+
build-and-test:
32+
needs:
33+
- generate-artifact-name
34+
uses: IntelligenceModding/actions/.github/workflows/build-and-test.yaml@master
35+
with:
36+
build_name: ${{ needs.generate-artifact-name.outputs.name }}
37+
pr: ${{ github.event_name == 'pull_request' && github.event.number || '' }}
38+
check: ${{ github.event_name != 'push' }}
39+
40+
publish:
41+
if: ${{ github.event_name == 'push' && contains(github.ref, 'release/') }}
42+
runs-on: self-hosted
43+
needs:
44+
- build-and-test
45+
steps:
46+
- name: Checkout sources
47+
uses: actions/checkout@v4
48+
- name: Setup Gradle
49+
uses: gradle/actions/setup-gradle@v4
50+
- name: Download Builds
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: ${{ needs.build-and-test.outputs.artifact-name }}
54+
path: build/libs
55+
- name: Patch Changelog
56+
run: ./gradlew patchChangelog
57+
- name: Github Release
58+
run: ./gradlew githubRelease
59+
- name: Publish Maven
60+
run: ./gradlew publishAllPublicationsToPublicRepository
61+
- name: Publish Modrinth
62+
run: ./gradlew modrinth
63+
- name: Publish CurseForge
64+
run: ./gradlew publishCurseForge

.github/workflows/build-and-test.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# https://github.com/orgs/community/discussions/51403
2+
3+
name: Comment Artifacts
4+
5+
on:
6+
workflow_run:
7+
types:
8+
- "completed"
9+
workflows:
10+
- "Build and Test"
11+
12+
permissions:
13+
actions: read
14+
attestations: read
15+
contents: read
16+
pull-requests: write
17+
18+
jobs:
19+
parse-metadata:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
PR_NUMBER: ${{ steps.metadata.outputs.PR_NUMBER }}
23+
HEAD_SHA: ${{ steps.metadata.outputs.HEAD_SHA }}
24+
ARTIFACT_ID: ${{ steps.metadata.outputs.ARTIFACT_ID }}
25+
ARTIFACT_URL: ${{ steps.metadata.outputs.ARTIFACT_URL }}
26+
ARTIFACT_EXP: ${{ steps.metadata.outputs.ARTIFACT_EXP }}
27+
ARTIFACT_NAME: ${{ steps.metadata.outputs.ARTIFACT_NAME }}
28+
steps:
29+
- name: Get Artifact URL & PR Info
30+
id: metadata
31+
env:
32+
GITHUB_TOKEN: ${{ github.token }}
33+
OWNER: ${{ github.repository_owner }}
34+
REPO: ${{ github.event.repository.name }}
35+
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }}
36+
PREVIOUS_JOB_ID: ${{ github.event.workflow_run.id }}
37+
run: |
38+
echo "Previous Job ID: $PREVIOUS_JOB_ID"
39+
40+
LOG_URL="/repos/$OWNER/$REPO/actions/runs/$PREVIOUS_JOB_ID/logs"
41+
echo "Getting previous logs: $LOG_URL"
42+
gh api "$LOG_URL" >_logs.zip
43+
echo "Unzipping logs"
44+
unzip -p _logs.zip >_build.txt
45+
46+
echo "Parsing logs"
47+
function parse_var {
48+
name=$1
49+
echo "Parsing output $name"
50+
line=$(cat _build.txt | grep -m 1 "output:${name}=" | cat)
51+
export parsed=${line#*"output:${name}="}
52+
}
53+
parse_var PR_NUMBER
54+
PR_NUMBER=$parsed
55+
echo "PR Number: $PR_NUMBER"
56+
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_OUTPUT"
57+
58+
parse_var HEAD_SHA
59+
HEAD_SHA=$parsed
60+
echo "Head sha: $HEAD_SHA"
61+
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_OUTPUT"
62+
63+
parse_var ARTIFACT_ID
64+
ARTIFACT_ID=$parsed
65+
echo "ARTIFACT ID: $ARTIFACT_ID"
66+
echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_OUTPUT"
67+
68+
parse_var ARTIFACT_URL
69+
ARTIFACT_URL=$parsed
70+
echo "ARTIFACT URL: $ARTIFACT_URL"
71+
echo "ARTIFACT_URL=$ARTIFACT_URL" >> "$GITHUB_OUTPUT"
72+
73+
if [[ "$ARTIFACT_ID" != "" ]]; then
74+
ARTIFACT_INFO="$(gh api "/repos/$OWNER/$REPO/actions/artifacts/$ARTIFACT_ID")"
75+
ARTIFACT_EXP=$(echo "$ARTIFACT_INFO" | jq -r ".expires_at")
76+
echo "ARTIFACT EXP: $ARTIFACT_EXP"
77+
echo "ARTIFACT_EXP=$ARTIFACT_EXP" >> "$GITHUB_OUTPUT"
78+
ARTIFACT_NAME=$(echo "$ARTIFACT_INFO" | jq -r ".name")
79+
echo "ARTIFACT NAME: $ARTIFACT_NAME"
80+
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
81+
fi
82+
exit 0
83+
84+
comment-success:
85+
if: ${{ needs.parse-metadata.outputs.PR_NUMBER != '' }}
86+
runs-on: ubuntu-latest
87+
needs:
88+
- parse-metadata
89+
steps:
90+
- name: Find Comment
91+
uses: peter-evans/find-comment@v3
92+
id: fc
93+
with:
94+
issue-number: ${{ needs.parse-metadata.outputs.PR_NUMBER }}
95+
comment-author: 'github-actions[bot]'
96+
body-includes: '## Build Preview'
97+
98+
- name: Update Comment
99+
env:
100+
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}"
101+
HEAD_SHA: ${{ needs.parse-metadata.outputs.HEAD_SHA }}
102+
ARTIFACT_URL: ${{ needs.parse-metadata.outputs.ARTIFACT_URL }}
103+
ARTIFACT_EXP: ${{ needs.parse-metadata.outputs.ARTIFACT_EXP }}
104+
ARTIFACT_NAME: ${{ needs.parse-metadata.outputs.ARTIFACT_NAME }}
105+
uses: peter-evans/create-or-update-comment@v4
106+
with:
107+
issue-number: ${{ needs.parse-metadata.outputs.PR_NUMBER }}
108+
comment-id: ${{ steps.fc.outputs.comment-id }}
109+
edit-mode: replace
110+
body: |-
111+
## Build Preview
112+
113+
[![badge]](${{ env.JOB_PATH }})
114+
115+
You can find files attached to the below linked Workflow Run URL (Logs).
116+
117+
| Name | Link |
118+
|-----------|-------------------------|
119+
| Commit | ${{ env.HEAD_SHA }} |
120+
| Logs | ${{ env.JOB_PATH }} |
121+
${{ env.ARTIFACT_URL && format('| Jar Files | [{0}]({1}) |', env.ARTIFACT_NAME, env.ARTIFACT_URL) || '' }}
122+
${{ env.ARTIFACT_EXP && format('| Expires At | {0} |', env.ARTIFACT_EXP) || '' }}
123+
124+
[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

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
10+
## First official Advanced Peripherals 1.21.1 alpha release to the whole public. Please report any bug to github!
11+
12+
### Added
13+
- Added our new textures!
14+
15+
### Fixed
16+
- Fixed that several item export and import related functions would not work with blocks from other mods
17+
- Fixed that functions with cooldowns which are used for the first time would throw an error
18+
19+
## [1.21.1-0.7.44a] - 2025-01-14
20+
21+
### Added
22+
- Colony Integrator back to 1.21.1
23+
24+
### Fixed
25+
- Villager & Wandering trader pocket and turtle trades
26+
- ME Bridges `getUsedItemStorage` and `getUsedFluidStorage`
27+
28+
## [1.21.1-0.7.43a] - 2025-01-13
29+
30+
Alpha 1.21.1 release
31+
The only thing that's missing is the colony integrator - we will add that soon.
32+
Please report any bugs to github!
33+
934
## [1.20.4-0.7.43a] - 2024-12-27
1035

1136
First official Advanced Peripherals 1.20.4 alpha release. Please report any bug to github!

0 commit comments

Comments
 (0)