Build updates.json file #36
This file contains hidden or 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
| name: Build updates.json file | |
| # Run this workflow on every push or pull request | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| TAG_NAME: ${{ github.ref }} | |
| # Docs on sharing data between jobs (between VMs): https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts#passing-data-between-jobs-in-a-workflow | |
| jobs: | |
| json_build: | |
| name: ubuntu build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # needed to create a release | |
| steps: | |
| - name: Download Repository | |
| uses: actions/checkout@v3 | |
| - name: Run Build and Deploy Script | |
| run: python build.py | |
| # If the ref is a commit (anything not a tag), generate a tag name using the date | |
| - name: Set current date as tag name | |
| run: echo "TAG_NAME=$(date +'%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV | |
| if: github.ref_type != 'tag' | |
| # Note: need to keep *.json files for compatability with older installers | |
| # Can be removed once it is unlikely people are using the old installer | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| #if: startsWith(github.ref, 'refs/tags/') # only publish tagged commits | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| files: | | |
| *.json | |
| *.zip | |
| draft: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |