Skip to content

Commit f23f9b6

Browse files
committed
adjusted the ci.cd to automatically update the server.properties resource-pack and resource-pack-sha1 fields on release.
.deploy
1 parent 7a6af02 commit f23f9b6

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/ci_cd.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
environment:
2424
name: ${{ github.ref_name }}
2525
url: ${{ steps.create_release.outputs.url }}
26+
outputs:
27+
VERSION: ${{ steps.get_version.outputs.VERSION }}
28+
SHA1: ${{ steps.calculate_sha1.outputs.SHA1 }}
2629
steps:
2730
- id: checkout
2831
name: Checkout
@@ -58,3 +61,36 @@ jobs:
5861
generate_release_notes: true
5962
prerelease: ${{ contains(github.event.head_commit.message, '.pre') }}
6063
tag_name: ${{ steps.get_version.outputs.VERSION }}
64+
65+
update-server:
66+
name: Update Server
67+
needs: release
68+
runs-on: [ubuntu-latest]
69+
environment:
70+
name: ${{ github.ref_name }}
71+
steps:
72+
- id: checkout
73+
name: Checkout
74+
uses: actions/checkout@main
75+
76+
- id: download_server_properties
77+
name: Download server.properties
78+
run: |
79+
wget ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_SERVER }}/server.properties -O temp/server.properties
80+
81+
- id: get_release
82+
name: Update server.properties with new resource pack info
83+
run: |
84+
cd ./temp
85+
sed -i 's/^resource-pack=.*$/resource-pack=https:\/\/github.com\/${{ github.repository }}\/releases\/download\/${{ needs.release.outputs.version }}/Illyria_v${{ needs.release.outputs.version }}.zip/' server.properties
86+
sed -i 's/^resource-pack-sha1=.*$/resource-pack-sha1=${{ needs.release.outputs.sha1 }}/' server.properties
87+
88+
- id: upload_server_properties
89+
name: Upload updated server.properties
90+
uses: SamKirkland/[email protected]
91+
with:
92+
server: ${{ secrets.FTP_SERVER }}
93+
username: ${{ secrets.FTP_USERNAME }}
94+
password: ${{ secrets.FTP_PASSWORD }}
95+
local-dir: ./temp
96+
server-dir: /

illyriamc/pack.mcmeta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"description": "\u00A78Adventure Awaits \n\u00A74By Illyria \u00A78for \u00A76MC 1.20.6 "
55
},
66
"version": {
7-
"name": "1.2.3"
7+
"name": "1.2.4"
88
}
99
}

0 commit comments

Comments
 (0)