Skip to content

Commit

Permalink
Setup GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mahabal committed Nov 13, 2019
0 parents commit 6362059
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/downloader.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# https://github.com/tsedlar
name: CI

on:
schedule:
# only run on a schedule, every 30 minutes
- cron: 0/30 * * * *

jobs:
update_gamepack:
runs-on: ubuntu-latest
container:
# image with AdoptOpenJDK 8 and git installed
image: mahabal/adoptopenjdk8-git:latest

steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Deploy gamepack
run: |
cd gamepacks/
curl -sL https://github.com/runetech/osrs-gamepack-downloader/releases/download/v1.2/osrs-gamepack-downloader.jar -o downloader.jar
REPO=$(echo ${{ github.repository }} | sed "s:.*/::")
BRANCH=$(echo ${{ github.ref }} | sed "s:.*/::")
git remote rm origin
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
git config user.name ${{ github.actor }}
git config user.email noreply@${{ github.actor }}.noreply.github.com
OSRS_REV=$(java -jar downloader.jar -r)
rm -f downloader.jar
git add .
git diff-index --quiet HEAD || GIT_AUTHOR_DATE=\"$(date -ur osrs-${OSRS_REV}.jar)\" GIT_COMMITTER_DATE=\"$(date -ur osrs-${OSRS_REV}.jar)\" git commit -am "Add osrs-${OSRS_REV}.jar" && git push origin HEAD:${BRANCH}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore the IntelliJ project files
*.iml
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# OldSchool RuneScape Gamepacks

[![Actions Status](https://github.com/runetech/osrs-gamepacks/workflows/CI/badge.svg?event=schedule)](https://github.com/runetech/osrs-gamepacks/actions)

0 comments on commit 6362059

Please sign in to comment.