-
-
Notifications
You must be signed in to change notification settings - Fork 11
74 lines (71 loc) · 2.55 KB
/
upload-to-discord.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Upload Builds to Discord
on:
workflow_dispatch:
registry_package:
types: [published]
schedule:
- cron: '0 0 * * 5'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
upload-to-discord:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
- name: Build with Gradle
run: ./gradlew build
- name: Get Weekly Commits
run: |
echo 'WEEKLY_COMMITS<<EOF' >> $GITHUB_ENV
git log --format="[\`%h\`](https://github.com/illucc/Kontraption/commit/%H) %s - %an" --since=7.days >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Send Embedded Discord Message
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
embed-title: "Kontraption Nightly from ${{ github.ref_name }}"
embed-description: |
Nightlies are posted every friday at 00:00 UTC
The nightly builds WILL have bugs and MIGHT be broken and not launch at all or corrupt your world! Use these builds with caution!
New commits:
${{ env.WEEKLY_COMMITS }}
embed-color: 0xFF6600
- name: Get Short Commit Hash
run: |
echo 'SHORT_COMMIT_HASH<<EOF' >> $GITHUB_ENV
git rev-parse --short HEAD >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Upload Build
uses: sinshutu/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: ./build/libs/kontraption-*
- name: Send Embedded Discord Message to VS
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.VS_DISCORD_WEBHOOK }}
embed-title: "Kontraption Nightly from ${{ github.ref_name }}"
embed-description: |
Nightlies are posted every friday at 00:00 UTC
The nightly builds WILL have bugs and MIGHT be broken and not launch at all or corrupt your world! Use these builds with caution!
New commits:
${{ env.WEEKLY_COMMITS }}
embed-color: 0xFF6600
- name: Upload Build to VS
uses: sinshutu/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.VS_DISCORD_WEBHOOK }}
with:
args: ./build/libs/kontraption-*