Skip to content

Commit 0d45cf3

Browse files
committed
add publish
1 parent 91f0092 commit 0d45cf3

5 files changed

Lines changed: 73 additions & 21 deletions

File tree

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 & 17 deletions
This file was deleted.

.github/workflows/pr-comment-artifacts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
body: |-
111111
## Build Preview
112112
113-
[![badge]]($JOB_PATH)
113+
[![badge]](${{ env.JOB_PATH }})
114114
115115
You can find files attached to the below linked Workflow Run URL (Logs).
116116

docs/RELEASE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ TOKEN=<github token with access to packages API>
3333
### Release process
3434

3535
- Execute `./gradlew patchChangelog` or manually update `CHANGELOG.md` and commit result to repository
36-
- Run `git tag <minecraft_version>-<version>` to create git tag and push it to repository via `git push --tags`
36+
- ~~Run `git tag <minecraft_version>-<version>` to create git tag and push it to repository via `git push --tags`~~
37+
- Upload project to github via `./gradlew githubRelease`
3738
- Upload project to curseforge via `./gradlew curseforge`
3839
- Upload project to modrinth via `./gradlew publishModrinth`
40+
- Upload project to maven via `./gradlew publishAllPublicationsToPublicRepository`
3941
- Update `mod_version` to next patch or minor version, what you want

gradle.properties

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ org.gradle.logging.level=info
44

55
# Minecraft related
66
mod_id=advancedperipherals
7-
mod_artifact_suffix=
7+
# do not include mod_version/minecraft_version with equals sign anywhere else in the file (even in comments)
8+
# also do not add space around the equal sign
9+
# since we are using poor grep command to do automation :p
10+
mod_version=0.8r
811
minecraft_version=1.19.2
12+
mod_artifact_suffix=
913
forge_version=43.4.0
1014
loader_version=43
11-
mod_version=0.8r
1215
release_type=release
1316
mappings_channel=parchment
1417
mappings_version=2022.11.20-1.19.2

0 commit comments

Comments
 (0)