Skip to content

Commit f744f25

Browse files
committed
Modular CI updates to match 20.1 branch
1 parent fc049bc commit f744f25

File tree

9 files changed

+192
-547
lines changed

9 files changed

+192
-547
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Announce Latest Nightly to Discord
2+
3+
on:
4+
workflow_call:
5+
6+
workflow_dispatch:
7+
inputs:
8+
diagnostic_mode:
9+
description: Diagnostic Mode
10+
type: boolean
11+
default: false
12+
required: true
13+
14+
jobs:
15+
vars:
16+
name: Get Variables
17+
runs-on: ubuntu-22.04
18+
outputs:
19+
mcVersion: ${{steps.minecraft.outputs.version}}
20+
neoVersion: ${{steps.neoforge.outputs.version}}
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set up JDK
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: temurin
32+
java-version: 21
33+
34+
- name: Setup Gradle
35+
uses: gradle/actions/setup-gradle@v3
36+
37+
- name: MC Version
38+
id: minecraft
39+
run: ./gradlew mcVersion -q >> "$GITHUB_OUTPUT"
40+
env:
41+
VERSION: ${{ steps.version.outputs.version }}
42+
43+
- name: NeoForge Version
44+
id: neoforge
45+
run: ./gradlew neoVersion -q >> "$GITHUB_OUTPUT"
46+
env:
47+
VERSION: ${{ steps.version.outputs.version }}
48+
49+
get-package-info:
50+
name: Get Latest Package Info
51+
runs-on: ubuntu-22.04
52+
outputs:
53+
version: ${{ steps.download-info.outputs.version }}
54+
steps:
55+
- name: Download Package Info
56+
id: download-info
57+
uses: compactmods/[email protected]
58+
env:
59+
GQL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
owner: compactmods
62+
repo: compactmachines
63+
group: dev.compactmods.compactmachines.compactmachines-neoforge
64+
filter: "^compactmachines-neoforge-(?:[\\d\\.]+)-nightly.jar$"
65+
outputFile: compactmachines-nightly.json
66+
67+
- name: Debug output
68+
run: |
69+
echo "Version: ${{ steps.download-info.outputs.version }}"
70+
cat compactmachines-nightly.json
71+
72+
- name: Read info into variable [latest]
73+
id: info
74+
run: echo "latestJson=$(cat compactmachines-nightly.json)" >> $GITHUB_OUTPUT
75+
76+
- name: Download JAR and prepare artifacts
77+
run: |
78+
mkdir release
79+
curl -L "${{ fromJson(steps.info.outputs.latestJson)[0].url }}" -o "release/${{ fromJson(steps.info.outputs.latestJson)[0].name}}"
80+
mv compactmachines-nightly.json release/compactmachines-nightly.json
81+
82+
- name: Add Artifact
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: release
86+
path: release
87+
88+
announce:
89+
name: Discord Announcement
90+
needs: [ vars, get-package-info ]
91+
runs-on: ubuntu-22.04
92+
steps:
93+
- name: Grab JAR and Info
94+
uses: actions/download-artifact@v4
95+
with:
96+
name: release
97+
path: .
98+
99+
- name: Read info into variable [latest]
100+
id: info
101+
run: echo "latestJson=$(cat compactmachines-nightly.json)" >> $GITHUB_OUTPUT
102+
103+
- name: Announce Release
104+
uses: compactmods/[email protected]
105+
env:
106+
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
107+
with:
108+
filename: ${{ fromJson(steps.info.outputs.latestJson)[0].name}}
109+
channel: ${{ secrets.NIGHTLY_CHANNEL_ID }}
110+
modName: Compact Machines
111+
modVersion: ${{ needs.get-package-info.outputs.version }}
112+
thumbnail: https://media.forgecdn.net/avatars/10/602/635460270800375500.png
113+
mcVersion: ${{ needs.vars.outputs.mcVersion }}
Lines changed: 6 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,13 @@
1-
name: Announce Latest Nightly to Discord
1+
name: Announce Latest Nightly Build to Discord
2+
env:
3+
GH_PKG_URL: "https://maven.pkg.github.com/${{ github.repository }}"
24

35
on:
4-
workflow_call:
5-
66
workflow_dispatch:
7-
inputs:
8-
diagnostic_mode:
9-
description: Diagnostic Mode
10-
type: boolean
11-
default: false
12-
required: true
137

148
jobs:
15-
vars:
16-
name: Get Variables
17-
runs-on: ubuntu-22.04
18-
outputs:
19-
mcVersion: ${{steps.minecraft.outputs.version}}
20-
neoVersion: ${{steps.neoforge.outputs.version}}
21-
22-
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v3
25-
with:
26-
fetch-depth: 0
27-
28-
- name: Set up JDK
29-
uses: actions/setup-java@v4
30-
with:
31-
distribution: temurin
32-
java-version: 21
33-
34-
- name: Setup Gradle
35-
uses: gradle/actions/setup-gradle@v3
36-
37-
- name: MC Version
38-
id: minecraft
39-
run: ./gradlew mcVersion -q >> "$GITHUB_OUTPUT"
40-
env:
41-
VERSION: ${{ steps.version.outputs.version }}
42-
43-
- name: NeoForge Version
44-
id: neoforge
45-
run: ./gradlew neoVersion -q >> "$GITHUB_OUTPUT"
46-
env:
47-
VERSION: ${{ steps.version.outputs.version }}
48-
499
get-package-info:
50-
name: Get Latest Package Info
10+
name: Latest Package Info
5111
runs-on: ubuntu-22.04
5212
outputs:
5313
version: ${{ steps.download-info.outputs.version }}
@@ -69,45 +29,7 @@ jobs:
6929
echo "Version: ${{ steps.download-info.outputs.version }}"
7030
cat compactmachines-nightly.json
7131
72-
- name: Read info into variable [latest]
73-
id: info
74-
run: echo "latestJson=$(cat compactmachines-nightly.json)" >> $GITHUB_OUTPUT
75-
76-
- name: Download JAR and prepare artifacts
77-
run: |
78-
mkdir release
79-
curl -L "${{ fromJson(steps.info.outputs.latestJson)[0].url }}" -o "release/${{ fromJson(steps.info.outputs.latestJson)[0].name}}"
80-
mv compactmachines-nightly.json release/compactmachines-nightly.json
81-
82-
- name: Add Artifact
83-
uses: actions/upload-artifact@v4
84-
with:
85-
name: release
86-
path: release
87-
8832
announce:
8933
name: Discord Announcement
90-
needs: [ vars, get-package-info ]
91-
runs-on: ubuntu-22.04
92-
steps:
93-
- name: Grab JAR and Info
94-
uses: actions/download-artifact@v4
95-
with:
96-
name: release
97-
path: .
98-
99-
- name: Read info into variable [latest]
100-
id: info
101-
run: echo "latestJson=$(cat compactmachines-nightly.json)" >> $GITHUB_OUTPUT
102-
103-
- name: Announce Release
104-
uses: compactmods/[email protected]
105-
env:
106-
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
107-
with:
108-
filename: ${{ fromJson(steps.info.outputs.latestJson)[0].name}}
109-
channel: ${{ secrets.NIGHTLY_CHANNEL_ID }}
110-
modName: Compact Machines
111-
modVersion: ${{ needs.get-package-info.outputs.version }}
112-
thumbnail: https://media.forgecdn.net/avatars/10/602/635460270800375500.png
113-
mcVersion: ${{ needs.vars.outputs.mcVersion }}
34+
uses: ./.github/workflows/_announce-latest-nightly.yml
35+
secrets: inherit

.github/workflows/manual-build.yml

Lines changed: 0 additions & 169 deletions
This file was deleted.

0 commit comments

Comments
 (0)