-
Notifications
You must be signed in to change notification settings - Fork 80
51 lines (44 loc) · 1.81 KB
/
_announce-latest-build.yml
File metadata and controls
51 lines (44 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Announce Latest Nightly to Discord
on:
workflow_call:
workflow_dispatch:
inputs:
diagnostic_mode:
description: Diagnostic Mode
type: boolean
default: false
required: true
jobs:
announce:
name: Discord Announcement
runs-on: ubuntu-22.04
steps:
- name: Grab JAR and Info
uses: actions/download-artifact@v8
with:
name: release
path: .
- name: Announce Timestamp
id: timestamp
run: echo "buildTimestamp=$(date --iso-8601=seconds)" >> $GITHUB_OUTPUT
- name: Read Package Info
id: package_info
run: echo "latestJson=$(cat compactmachines.json)" >> $GITHUB_OUTPUT
- name: Read Version Info File
id: version_info
run: echo "versionInfo=$(cat version-info.json)" >> $GITHUB_OUTPUT
- name: Read Version Info
id: version
run: echo version=${{ fromJson( steps.version_info.outputs.versionInfo ).version }} >> $GITHUB_OUTPUT
- name: Announce Release
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{ secrets.DISCORD_NIGHTLY_WEBHOOK }}
avatar-url: "https://compactmods.dev/personal-shrinking-device.png"
content: "**New Version Available: Compact Machines v${{ steps.version.outputs.version }}**"
filename: ${{ fromJson(steps.package_info.outputs.latestJson)[0].name }}
embed-title: "**Mod File Information**"
embed-description: "Filename: ${{ fromJson(steps.package_info.outputs.latestJson)[0].name}}"
embed-url: "https://www.curseforge.com/minecraft/mc-mods/compact-machines"
embed-thumbnail-url: "https://media.forgecdn.net/avatars/thumbnails/10/602/64/64/635460270800375500.png"
embed-timestamp: ${{ steps.timestamp.outputs.buildTimestamp }}