Skip to content

Commit 540f5f3

Browse files
committed
[CI] Add version info to package data, maybe fix latest build announce
1 parent 21f8eed commit 540f5f3

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/_announce-latest-build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,23 @@ jobs:
2525
id: timestamp
2626
run: echo "buildTimestamp=$(date --iso-8601=seconds)" >> $GITHUB_OUTPUT
2727

28+
- name: Read Package Info
29+
id: package_info
30+
run: echo "latestJson=$(cat compactmachines.json)" >> $GITHUB_OUTPUT
31+
32+
- name: Read Version Info
33+
id: version_info
34+
run: echo "version=${{ fromJson($(cat version-info.json)).version }}" >> $GITHUB_OUTPUT
35+
2836
- name: Announce Release
2937
uses: tsickert/discord-webhook@v6.0.0
3038
with:
3139
webhook-url: ${{ secrets.DISCORD_NIGHTLY_WEBHOOK }}
3240
avatar-url: "https://compactmods.dev/personal-shrinking-device.png"
33-
content: "**New Version Available: Compact Machines v${{ needs.get-package-info.outputs.version }}**"
34-
filename: ${{ fromJson(steps.info.outputs.latestJson)[0].name }}
41+
content: "**New Version Available: Compact Machines v${{ steps.version_info.outputs.version }}**"
42+
filename: ${{ fromJson(steps.package_info.outputs.latestJson)[0].name }}
3543
embed-title: "**Mod File Information**"
36-
embed-description: "Filename: ${{ fromJson(steps.info.outputs.latestJson)[0].name}}"
44+
embed-description: "Filename: ${{ fromJson(steps.package_info.outputs.latestJson)[0].name}}"
3745
embed-url: "https://www.curseforge.com/minecraft/mc-mods/compact-machines"
3846
embed-thumbnail-url: "https://media.forgecdn.net/avatars/thumbnails/10/602/64/64/635460270800375500.png"
3947
embed-timestamp: ${{ steps.timestamp.outputs.buildTimestamp }}

.github/workflows/_download-latest-package-info.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
echo "Version: ${{ steps.download-info.outputs.version }}"
5353
cat compactmachines.json
5454
55+
- name: Version JSON
56+
run: echo "{\"version\": \"${{ steps.download-info.outputs.version }}\"}" >> "release/version-info.json"
57+
5558
- name: Read info into variable [latest]
5659
id: info
5760
run: echo "latestJson=$(cat compactmachines.json)" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)