diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 00000000..d0a9dd0e --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,61 @@ +name: Compile files into downloadable formats +on: [push] +jobs: + compile_files: + runs-on: ubuntu-latest + steps: + - name: Set up Git repository + uses: actions/checkout@v2 + - name: Set up environment + run: | + sudo apt-get update && \ + sudo apt-get install -y python3-pip && \ + sudo -H pip3 install seaborn + - name: Run data building scripts + run: | + wget https://github.com/niemasd/GameDB/raw/main/scripts/create_complete_data_json.py && python3 create_complete_data_json.py && \ + wget https://github.com/niemasd/GameDB/raw/main/scripts/create_titles_json.py && python3 create_titles_json.py && \ + wget https://github.com/niemasd/GameDB/raw/main/scripts/create_complete_data_tsv.py && python3 create_complete_data_tsv.py && \ + wget https://github.com/niemasd/GameDB/raw/main/scripts/plot_dates_release.py && python3 plot_dates_release.py "Sony PlayStation (SNES)" + - name: Generate release tag + id: tag + run: | + echo "::set-output name=release_tag::$(date +"%Y-%m-%d_%H-%M-%S")" + - name: Publish release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.tag.outputs.release_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload complete data JSON to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: data.json + asset_name: SNES.data.json + tag: ${{ steps.tag.outputs.release_tag }} + overwrite: true + - name: Upload titles JSON to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: titles.json + asset_name: SNES.titles.json + tag: ${{ steps.tag.outputs.release_tag }} + overwrite: true + - name: Upload complete data TSV to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: data.tsv + asset_name: SNES.data.tsv + tag: ${{ steps.tag.outputs.release_tag }} + overwrite: true + - name: Upload release date distribution PDF to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: release_dates.pdf + asset_name: SNES.release_dates.pdf + tag: ${{ steps.tag.outputs.release_tag }} + overwrite: true