Skip to content

既存の1.19.4のモブデータ(NBT)を1.20.4用に更新 #2208

既存の1.19.4のモブデータ(NBT)を1.20.4用に更新

既存の1.19.4のモブデータ(NBT)を1.20.4用に更新 #2208

Workflow file for this run

name: Server Notice Action
on: push
jobs:
notice:
name: notice mcrcon
runs-on: ubuntu-latest
steps:
- name: Public IP
id: ip
uses: haythem/public-ip@v1.2
- name: Print Public IP
run: |
echo ${{ steps.ip.outputs.ipv4 }}
echo ${{ steps.ip.outputs.ipv6 }}
- uses: actions/checkout@v2
- name: Add Firewalld IP Address
id: FIREWALL
run: |
ADD_FIREWALL=`curl "https://api.vultr.com/v2/firewalls/${{ secrets.VULTR_FIREWALL_GROUP_ID }}/rules" \
-X POST \
-H "Authorization: Bearer ${{ secrets.VULTR_API_KEY }}" \
-H "Content-Type: application/json" \
--data '{
"ip_type": "v4",
"protocol": "tcp",
"port": "${{ secrets.TUSB_SERVER_RCON_PORT }}",
"subnet": "${{ steps.ip.outputs.ipv4 }}",
"subnet_size": 32,
"source": "",
"notes": "GitHub Action Firewall Rule on Rcon Port"
}'`
firewall_id=`echo "$ADD_FIREWALL" | jq '.firewall_rule.id'`
echo "::set-output name=ID::$firewall_id"
echo "-----DEBUG-----"
echo "$ADD_FIREWALL"
- name: Install mcrcon
run: |
wget https://github.com/Tiiffi/mcrcon/releases/download/v0.7.1/mcrcon-0.7.1-linux-x86-64.tar.gz
tar -zxvf mcrcon-0.7.1-linux-x86-64.tar.gz
mv mcrcon-0.7.1-linux-x86-64/mcrcon /usr/local/bin/
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- name: Sleep for 45 seconds
uses: jakejarvis/wait-action@master
with:
time: '45s'
- name: Notice Bungeecord
run: |
/usr/local/bin/mcrcon -H ${{ secrets.TUSB_MINECRAFT_SERVER_REMOTE_HOST_IP }} -p ${{ secrets.TUSB_SERVER_RCON_PASSWORD }} -P ${{ secrets.TUSB_SERVER_RCON_PORT }} -w 5 "alertraw [\"\",{\"text\":\"[INFO] \"},{\"text\":\"\u30ea\u30dd\u30b8\u30c8\u30ea\u304c\u66f4\u65b0\u3055\u308c\u307e\u3057\u305f\u3002\",\"bold\":true,\"color\":\"yellow\"},{\"text\":\"(Hash: \"},{\"text\":\"${{ steps.vars.outputs.sha_short }}\",\"italic\":true,\"underlined\":true,\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://github.com/TUSB/TheUnusualSkyBlock/commit/${{ steps.vars.outputs.sha_short }}\"}},{\"text\":\")\"}]"
- if: always()
name: Delete Firewalld IP Address
run: |
DELETE_FIREWALL=$(curl "https://api.vultr.com/v2/firewalls/${{ secrets.VULTR_FIREWALL_GROUP_ID }}/rules/${{ steps.FIREWALL.outputs.ID }}" \
-X DELETE \
-H 'Authorization: Bearer ${{ secrets.VULTR_API_KEY }}')
echo $DELETE_FIREWALL
echo "-----DEBUG-----"
echo "$DELETE_FIREWALL"