diff --git a/.github/workflows/enable-orcsoberfest-island-pack.yml b/.github/workflows/enable-orcsoberfest-island-pack.yml new file mode 100644 index 000000000..6efe6a400 --- /dev/null +++ b/.github/workflows/enable-orcsoberfest-island-pack.yml @@ -0,0 +1,25 @@ +name: 'Enable Orcsoberfest Island pack' + +on: + schedule: + # Run annually at 04:00 UTC on February 1st. + - cron: '0 4 1 2 *' + workflow_dispatch: + +jobs: + import-markers: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - name: Install dependencies + run: npm install + - name: Enable pack + run: | + scripts/enable-pack.sh orcsoberfest + git config user.name 'Mathias Bynens' + git config user.email 'mathias@qiwi.be' + git commit data/markers.json -m 'Enable Orcsoberfest Island maps' -m 'This patch replaces the Percht Island maps (and their markers) with the Orcsoberfest Island maps (and their markers) in preparation for the upcoming event.' + git push diff --git a/.github/workflows/enable-percht-island.yml b/.github/workflows/enable-percht-island.yml new file mode 100644 index 000000000..3f66bc24a --- /dev/null +++ b/.github/workflows/enable-percht-island.yml @@ -0,0 +1,25 @@ +name: 'Enable Percht Island pack' + +on: + schedule: + # Run annually at 04:00 UTC on December 1st. + - cron: '0 4 1 12 *' + workflow_dispatch: + +jobs: + import-markers: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - name: Install dependencies + run: npm install + - name: Enable pack + run: | + scripts/enable-pack.sh percht + git config user.name 'Mathias Bynens' + git config user.email 'mathias@qiwi.be' + git commit data/markers.json -m 'Enable Percht Island maps' -m 'This patch replaces the Orcsoberfest Island maps (and their markers) with the Percht Island maps (and their markers) in preparation for the upcoming event.' + git push diff --git a/scripts/enable-pack.sh b/scripts/enable-pack.sh index 8b4f280e2..111247ab8 100755 --- a/scripts/enable-pack.sh +++ b/scripts/enable-pack.sh @@ -3,11 +3,14 @@ # Navigate to the root of the repository. cd "$(dirname "${BASH_SOURCE}")/.."; +# Ensure `tibia-maps` is in the PATH on CI. +PATH="${PATH}:$(pwd)/node_modules/.bin"; + if [ -z "${1}" ]; then echo 'No argument supplied. Example usage:'; echo ''; - echo './scripts/enable-pack.sh orcsoberfest'; - echo './scripts/enable-pack.sh percht'; + echo 'scripts/enable-pack.sh orcsoberfest'; + echo 'scripts/enable-pack.sh percht'; exit 0; fi; @@ -20,7 +23,7 @@ echo 'Generating minimap files…'; tibia-maps --from-data=data --output-dir=minimap; echo "Merging minimap files from the \`${1}-island\` pack…"; cp -f extra/"${1}"-island/*.png minimap; -echo 'Converting updated minimap back to \`data/*\`…'; +echo 'Converting updated minimap back to `data/*`…'; tibia-maps --from-minimap=./minimap --output-dir=./data; echo 'Updating markers…'; node scripts/enable-marker-pack.js "${1}";