-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a541c5c
commit becc6d6
Showing
2 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,18 +10,23 @@ on: | |
projectsuffix: | ||
required: true | ||
type: string | ||
mcversion: | ||
tag: | ||
required: true | ||
type: string | ||
tag: | ||
rel_type: | ||
required: true | ||
type: string | ||
mcversion: | ||
required: true | ||
type: string | ||
news: | ||
required: true | ||
type: string | ||
|
||
# Project IDs of the modpack. | ||
env: | ||
PROJECT_ID: "399664" | ||
CF_PROJECT_ID: "399664" | ||
MR_PROJECT_ID: "ZmoIrOsS" | ||
|
||
jobs: | ||
release-github: | ||
|
@@ -32,14 +37,17 @@ jobs: | |
uses: actions/download-artifact@v4 | ||
with: | ||
name: modpack | ||
|
||
- name: Download serverpack | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: serverpack | ||
|
||
- name: Download changelog | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: changelog | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
|
@@ -55,55 +63,50 @@ jobs: | |
name: Deploy to CurseForge | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if CF_API_TOKEN exist | ||
- name: Check if CF_TOKEN exist | ||
shell: bash | ||
run: | | ||
if [ "${{ secrets.CF_API_TOKEN }}" == '' ]; then | ||
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 | ||
if [ "${{ secrets.CF_TOKEN }}" == '' ]; then | ||
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 | ||
fi | ||
- name: Download modpack | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: modpack | ||
|
||
- name: Download serverpack | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: serverpack | ||
- name: Get release type | ||
id: release_type | ||
run: | | ||
rel_type="release" | ||
case "${{ inputs.tag }}" in | ||
*alpha*) rel_type="alpha" ;; | ||
*beta*) rel_type="beta" ;; | ||
*) rel_type="release" ;; | ||
esac | ||
echo "type=$rel_type" >> $GITHUB_OUTPUT | ||
|
||
- name: Create release | ||
id: cf_release | ||
uses: itsmeow/[email protected] | ||
with: | ||
token: ${{ secrets.CF_API_TOKEN }} | ||
project_id: ${{ env.PROJECT_ID }} | ||
token: ${{ secrets.CF_TOKEN }} | ||
project_id: ${{ env.CF_PROJECT_ID }} | ||
file_path: ${{ inputs.projectname }}-${{ inputs.projectsuffix }}.zip | ||
display_name: ${{ inputs.projectname }}-${{ inputs.projectsuffix }} | ||
changelog: See https://github.com/juraj-hrivnak/Underdog/releases/tag/${{ inputs.tag }} | ||
changelog_type: markdown | ||
game_versions: ${{ inputs.mcversion }} | ||
game_endpoint: minecraft | ||
release_type: ${{ steps.release_type.outputs.type }} | ||
release_type: ${{ inputs.rel_type }} | ||
|
||
- name: Upload server pack | ||
uses: itsmeow/[email protected] | ||
with: | ||
token: ${{ secrets.CF_API_TOKEN }} | ||
token: ${{ secrets.CF_TOKEN }} | ||
parent_file_id: ${{ steps.cf_release.outputs.id }} | ||
project_id: ${{ env.PROJECT_ID }} | ||
project_id: ${{ env.CF_PROJECT_ID }} | ||
file_path: ${{ inputs.projectname }}-${{ inputs.projectsuffix }}-Server-Pack.zip | ||
display_name: ${{ inputs.projectname }}-${{ inputs.projectsuffix }}-Server-Pack | ||
changelog: See https://github.com/juraj-hrivnak/Underdog/releases/tag/${{ inputs.tag }} | ||
changelog_type: markdown | ||
game_endpoint: minecraft | ||
release_type: ${{ steps.release_type.outputs.type }} | ||
release_type: ${{ inputs.rel_type }} | ||
|
||
- name: Create Discord message | ||
id: message | ||
shell: bash | ||
|
@@ -114,13 +117,15 @@ jobs: | |
message+="[Issues](<https://github.com/juraj-hrivnak/Underdog/issues>)\n" | ||
message+="### What's new?\n${{ inputs.news }}" | ||
echo "markdown=$message" >> $GITHUB_OUTPUT | ||
- name: Send Discord message | ||
uses: "hugoalh/[email protected]" | ||
with: | ||
key: ${{ secrets.DISCORD_WEBHOOK_2 }} | ||
content: "${{ steps.message.outputs.markdown }}" | ||
key: ${{ secrets.DISCORD_WEBHOOK_ANNOUNCEMENTS }} | ||
username: "UnderBot" | ||
avatar_url: "https://media.forgecdn.net/avatars/828/211/638215807562150866.png" | ||
content: "${{ steps.message.outputs.markdown }}" | ||
embeds: "[{}]" | ||
|
||
update-changelogs: | ||
name: Update Changelogs | ||
|
@@ -129,21 +134,25 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download changelog | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: changelog | ||
path: pax/changelogs | ||
|
||
- name: Move changelogs | ||
run: | | ||
rm CHANGELOG.md | ||
cp pax/changelogs/TEMPLATE.md CHANGELOG.md | ||
- name: Commit changelogs | ||
run: | | ||
git add . | ||
git config --local user.name "Juraj Hrivnak" | ||
git config --local user.email "[email protected]" | ||
git commit -m "Automatically update changelogs" -a | ||
- name: Push changelogs | ||
uses: ad-m/[email protected] | ||
with: | ||
|