Skip to content

Commit becc6d6

Browse files
committed
Update workflows
1 parent a541c5c commit becc6d6

File tree

2 files changed

+46
-24
lines changed

2 files changed

+46
-24
lines changed

.github/workflows/BuildMultiplatform.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
projectname: ${{ steps.info.outputs.projectname }}
1818
projectsuffix: ${{ steps.info.outputs.projectsuffix }}
1919
tag: ${{ steps.info.outputs.tag }}
20+
rel_type: ${{ steps.info.outputs.rel_type }}
2021
diff: ${{ steps.info.outputs.diff }}
2122

2223
steps:
@@ -71,6 +72,18 @@ jobs:
7172
echo "📃 projectsuffix=build.${{ github.run_number }}"
7273
fi
7374
75+
# -- RELEASE TYPE
76+
77+
rel_type="release"
78+
case $latest_tag in
79+
*alpha*) rel_type="alpha" ;;
80+
*beta*) rel_type="beta" ;;
81+
*) rel_type="release" ;;
82+
esac
83+
84+
echo "rel_type=$rel_type" >> $GITHUB_OUTPUT
85+
echo "📃 rel_type=$rel_type"
86+
7487
# -- DIFF --
7588
7689
latest_tagged_commit=$(git rev-list -n 1 --pretty=format:"%h" $latest_tag | sed -n 2p)

.github/workflows/Release.yml

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,23 @@ on:
1010
projectsuffix:
1111
required: true
1212
type: string
13-
mcversion:
13+
tag:
1414
required: true
1515
type: string
16-
tag:
16+
rel_type:
17+
required: true
18+
type: string
19+
mcversion:
1720
required: true
1821
type: string
1922
news:
2023
required: true
2124
type: string
2225

26+
# Project IDs of the modpack.
2327
env:
24-
PROJECT_ID: "399664"
28+
CF_PROJECT_ID: "399664"
29+
MR_PROJECT_ID: "ZmoIrOsS"
2530

2631
jobs:
2732
release-github:
@@ -32,14 +37,17 @@ jobs:
3237
uses: actions/download-artifact@v4
3338
with:
3439
name: modpack
40+
3541
- name: Download serverpack
3642
uses: actions/download-artifact@v4
3743
with:
3844
name: serverpack
45+
3946
- name: Download changelog
4047
uses: actions/download-artifact@v4
4148
with:
4249
name: changelog
50+
4351
- name: Create release
4452
uses: softprops/action-gh-release@v2
4553
with:
@@ -55,55 +63,50 @@ jobs:
5563
name: Deploy to CurseForge
5664
runs-on: ubuntu-latest
5765
steps:
58-
- name: Check if CF_API_TOKEN exist
66+
- name: Check if CF_TOKEN exist
5967
shell: bash
6068
run: |
61-
if [ "${{ secrets.CF_API_TOKEN }}" == '' ]; then
62-
echo '::error::No value found for secret key `CF_API_TOKEN`. See https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1
69+
if [ "${{ secrets.CF_TOKEN }}" == '' ]; then
70+
echo '::error::No value found for secret key `CF_TOKEN`. See https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1
6371
fi
72+
6473
- name: Download modpack
6574
uses: actions/download-artifact@v4
6675
with:
6776
name: modpack
77+
6878
- name: Download serverpack
6979
uses: actions/download-artifact@v4
7080
with:
7181
name: serverpack
72-
- name: Get release type
73-
id: release_type
74-
run: |
75-
rel_type="release"
76-
case "${{ inputs.tag }}" in
77-
*alpha*) rel_type="alpha" ;;
78-
*beta*) rel_type="beta" ;;
79-
*) rel_type="release" ;;
80-
esac
81-
echo "type=$rel_type" >> $GITHUB_OUTPUT
82+
8283
- name: Create release
8384
id: cf_release
8485
uses: itsmeow/curseforge-upload@v3.1.2
8586
with:
86-
token: ${{ secrets.CF_API_TOKEN }}
87-
project_id: ${{ env.PROJECT_ID }}
87+
token: ${{ secrets.CF_TOKEN }}
88+
project_id: ${{ env.CF_PROJECT_ID }}
8889
file_path: ${{ inputs.projectname }}-${{ inputs.projectsuffix }}.zip
8990
display_name: ${{ inputs.projectname }}-${{ inputs.projectsuffix }}
9091
changelog: See https://github.com/juraj-hrivnak/Underdog/releases/tag/${{ inputs.tag }}
9192
changelog_type: markdown
9293
game_versions: ${{ inputs.mcversion }}
9394
game_endpoint: minecraft
94-
release_type: ${{ steps.release_type.outputs.type }}
95+
release_type: ${{ inputs.rel_type }}
96+
9597
- name: Upload server pack
9698
uses: itsmeow/curseforge-upload@v3.1.2
9799
with:
98-
token: ${{ secrets.CF_API_TOKEN }}
100+
token: ${{ secrets.CF_TOKEN }}
99101
parent_file_id: ${{ steps.cf_release.outputs.id }}
100-
project_id: ${{ env.PROJECT_ID }}
102+
project_id: ${{ env.CF_PROJECT_ID }}
101103
file_path: ${{ inputs.projectname }}-${{ inputs.projectsuffix }}-Server-Pack.zip
102104
display_name: ${{ inputs.projectname }}-${{ inputs.projectsuffix }}-Server-Pack
103105
changelog: See https://github.com/juraj-hrivnak/Underdog/releases/tag/${{ inputs.tag }}
104106
changelog_type: markdown
105107
game_endpoint: minecraft
106-
release_type: ${{ steps.release_type.outputs.type }}
108+
release_type: ${{ inputs.rel_type }}
109+
107110
- name: Create Discord message
108111
id: message
109112
shell: bash
@@ -114,13 +117,15 @@ jobs:
114117
message+="[Issues](<https://github.com/juraj-hrivnak/Underdog/issues>)\n"
115118
message+="### What's new?\n${{ inputs.news }}"
116119
echo "markdown=$message" >> $GITHUB_OUTPUT
120+
117121
- name: Send Discord message
118122
uses: "hugoalh/send-discord-webhook-ghaction@v6.0.2"
119123
with:
120-
key: ${{ secrets.DISCORD_WEBHOOK_2 }}
121-
content: "${{ steps.message.outputs.markdown }}"
124+
key: ${{ secrets.DISCORD_WEBHOOK_ANNOUNCEMENTS }}
122125
username: "UnderBot"
123126
avatar_url: "https://media.forgecdn.net/avatars/828/211/638215807562150866.png"
127+
content: "${{ steps.message.outputs.markdown }}"
128+
embeds: "[{}]"
124129

125130
update-changelogs:
126131
name: Update Changelogs
@@ -129,21 +134,25 @@ jobs:
129134
steps:
130135
- name: Checkout
131136
uses: actions/checkout@v4
137+
132138
- name: Download changelog
133139
uses: actions/download-artifact@v4
134140
with:
135141
name: changelog
136142
path: pax/changelogs
143+
137144
- name: Move changelogs
138145
run: |
139146
rm CHANGELOG.md
140147
cp pax/changelogs/TEMPLATE.md CHANGELOG.md
148+
141149
- name: Commit changelogs
142150
run: |
143151
git add .
144152
git config --local user.name "Juraj Hrivnak"
145153
git config --local user.email "juraj-hrivnak@users.noreply.github.com"
146154
git commit -m "Automatically update changelogs" -a
155+
147156
- name: Push changelogs
148157
uses: ad-m/github-push-action@v0.8.0
149158
with:

0 commit comments

Comments
 (0)