Sprite differ #222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
inputs: | |
AS_ARTIFACTS: | |
description: "Upload as artifacts" | |
required: false | |
default: 'false' | |
OLD_CACHE: | |
description: "Previous cache version" | |
required: false | |
NEW_CACHE: | |
description: "Next cache version" | |
required: false | |
name: Sprite differ | |
jobs: | |
compare: | |
name: "Sprite comparison between OSRS revs" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Generate sprites and diffs | |
id: build | |
env: | |
OLD_CACHE: ${{ github.event.inputs.OLD_CACHE }} | |
NEW_CACHE: ${{ github.event.inputs.NEW_CACHE }} | |
run: | | |
chmod +x execute.sh | |
bash execute.sh | |
- name: Upload sprites and diff to releases | |
uses: ncipollo/release-action@v1 | |
if: ${{ github.event.inputs.AS_ARTIFACTS == 'false' }} | |
with: | |
name: Sprite dump ${{ steps.build.outputs.new_cache }} | |
allowUpdates: true | |
omitBody: true | |
tag: ${{ steps.build.outputs.new_cache }} | |
artifacts: "cache/*-spritesheet-diff.png,cache/*-sprites.zip,cache/*-diff.zip" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit: master | |
- name: Upload sprites and diff as artifacts | |
if: ${{ github.event.inputs.AS_ARTIFACTS == 'true'}} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sprite-diffs-${{ steps.build.outputs.new_cache }} | |
path: | | |
cache/*-spritesheet-diff.png | |
cache/*-sprites.zip | |
cache/*-diff.zip | |
- name: Fetch resource-packs sample-vanilla | |
uses: actions/checkout@v2 | |
with: | |
repository: 'melkypie/resource-packs' | |
ref: 'refs/heads/sample-vanilla' | |
path: 'sample-vanilla' | |
ssh-key: ${{ secrets.RP_DEPLOY_KEY }} | |
- name: Generate changes to sample-vanilla | |
env: | |
CACHE: ${{ steps.build.outputs.new_cache }} | |
run: | | |
java -Dresources.inputFolder="cache/$CACHE/sprites" -Dresources.outputFolder="sample-vanilla" -jar shadow.jar build-sample | |
- name: Push changes to sample-vanilla | |
uses: EndBug/add-and-commit@v7 | |
with: | |
add: '-A' | |
message: Add changes by update ${{ steps.build.outputs.new_cache }} | |
branch: sample-vanilla | |
pull_strategy: 'NO-PULL' | |
cwd: './sample-vanilla' | |
default_author: github_actions |