Skip to content

Commit

Permalink
Automate Orcsoberfest/Percht Island updates
Browse files Browse the repository at this point in the history
Closes #104.
  • Loading branch information
mathiasbynens committed Oct 20, 2020
1 parent fc3dda0 commit 6038e37
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/enable-orcsoberfest-island-pack.yml
Original file line number Diff line number Diff line change
@@ -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 '[email protected]'
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
25 changes: 25 additions & 0 deletions .github/workflows/enable-percht-island.yml
Original file line number Diff line number Diff line change
@@ -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 '[email protected]'
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
7 changes: 5 additions & 2 deletions scripts/enable-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6038e37

Please sign in to comment.