diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f6720fe5..52d89d0f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,8 +19,9 @@ on: jobs: deploy: # Do not run the scheduled workflow on forks - if: github.event != 'schedule' || github.repository_owner == 'Cockatrice' + if: github.event_name != 'schedule' || github.repository_owner == 'Cockatrice' + name: Check for new spoiler runs-on: ubuntu-latest env: @@ -73,3 +74,5 @@ jobs: git add -A . git commit -m "Deploy: $GITHUB_SHA" git push + deploy_commit=`git rev-parse HEAD` + echo "::notice title=New data uploaded::See deployment: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/commit/$deploy_commit" diff --git a/README.md b/README.md index 12762415..6632c72a 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ # Magic-Spoiler [![Discord](https://img.shields.io/discord/314987288398659595?label=Discord&logo=discord&logoColor=white)](https://discord.gg/3Z9yzmA) [![Gitter Chat](https://img.shields.io/gitter/room/Cockatrice/Magic-Spoiler)](https://gitter.im/Cockatrice/Magic-Spoiler) # -Magic-Spoiler is a Python script to scrape [Scryfall](https://scryfall.com) to compile XML files (Cockatrice formatted) and application-ready JSON files (MTGJSON formatted) with information about spoiled cards from upcoming sets. +Magic-Spoiler is a Python script to query the [Scryfall](https://scryfall.com) API to compile XML files (Cockatrice formatted) and application-ready JSON files (MTGJSON formatted) with information about spoiled cards from upcoming sets. -## Output [![Build Status](https://github.com/Cockatrice/Magic-Spoiler/workflows/Deploy/badge.svg?branch=master&event=schedule)](https://github.com/Cockatrice/Magic-Spoiler/actions?query=workflow%3ADeploy+event%3Aschedule+branch%3Amaster) ## +## Output [![Build Status](https://github.com/Cockatrice/Magic-Spoiler/workflows/Deploy/badge.svg?branch=master)](https://github.com/Cockatrice/Magic-Spoiler/actions?query=workflow%3ADeploy+event%3Aworkflow_dispatch+event%3Aschedule+branch%3Amaster) ## >**Enable "Download Spoilers Automatically" in `Cockatrice → Settings → Card Sources → Spoilers` to get updates automatically pushed to your client!**
You can also [add the desired .xml file(s) to your customsets folder manually](https://github.com/Cockatrice/Cockatrice/wiki/Custom-Cards-&-Sets#to-add-custom-sets-follow-these-steps) to make Cockatrice use it. @@ -17,8 +17,10 @@ Just looking for XML or JSON files? [They are in our `files` branch!](https://g When run by our CI, the script automatically updates the files and uploads new versions to this branch. ([History of changes](https://github.com/Cockatrice/Magic-Spoiler/commits/files))
GitHub Actions are scheduled to autoamtically run on a daily basis. -## Errors ## -Noticed an error in the card data? Check out our [Contributing file](https://github.com/Cockatrice/Magic-Spoiler/blob/master/.github/CONTRIBUTING.md) for information on how to help! +## Contributing ## +Noticed an error in the card data? Check out our [Contributing file](https://github.com/Cockatrice/Magic-Spoiler/blob/master/.github/CONTRIBUTING.md) for information on how to help fixing it! + +We do happily accept PR's that improve our script as well! ## Running ## @@ -36,8 +38,11 @@ pip install -r requirements.txt $> python -m magic_spoiler ``` -Outputs the following files to `out/` directory:
-`spoiler.xml`, `spoiler.json`
-`{SET_CODE}.xml`, `{SET_CODE}.json` -> **spoiler** → files contain all currently available spoilers from different sets
-> **{SETCODE}** → files contain just the spoiler available for this single set
+### Output ### + +All XML and JSON spoiler files are written to the `out/` directory: + +| File Name | Content | +|:--|:--| +| `spoiler.xml`, `spoiler.json` | files contain **all** currently available spoilers from different **sets** | +| `{SET_CODE}.xml`, `{SET_CODE}.json` | files contain just the spoiler available for this **single set** | diff --git a/magic_spoiler/__main__.py b/magic_spoiler/__main__.py index c23ded3a..b2c5882f 100644 --- a/magic_spoiler/__main__.py +++ b/magic_spoiler/__main__.py @@ -644,11 +644,12 @@ def main() -> None: # Cleanup outdated stuff that's not necessary changed |= delete_old_files() - # Set output to deploy + # Enable deployment on changes (used in CI) if changed: print("::set-output name=deploy::true") else: print("::set-output name=deploy::false") + print("::notice title=No updates available::No new spoiler cards found for deployment") if __name__ == "__main__":