Update Release Workflow To Check Version (#615)

This commit is contained in:
Ben C 2023-07-01 13:21:01 -04:00 committed by GitHub
commit ba2f6077ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,16 +19,30 @@ on:
- "*.md"
- "NewHorizons/Schemas/**"
- "LICENSE"
- ".gitignore"
- ".gitignore"
jobs:
Check_Version:
name: Check Version
if: ${{ contains(github.event.pull_request.labels.*.name, 'update-pr') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: "actions/checkout@v3"
- name: Read Manifest
id: read-manifest
run: echo "manifest=$(< ./NewHorizons/manifest.json sed ':a;N;$!ba;s/\n/ /g')" >> $GITHUB_OUTPUT
- name: Error
if: ${{ steps.read-manifest.outputs.version != github.event.pull_request.title }}
run: echo "::error file=manifest.json,title=Version Error::Hey DUMB-DUMB UPDATE THE MANIFEST VERSION" && exit 1
Build:
if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'update-pr') }}
needs: Check_Version
if: ${{ needs.Check_Version.result == 'success' && (github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'update-pr')) }}
uses: ./.github/workflows/build.yaml
with:
build_type: Release
Update_Schemas:
name: 'Update Schemas'
name: "Update Schemas"
needs: Build
if: ${{ needs.Build.outputs.schemas_changed == 'true' && github.ref == 'refs/heads/main' }} # Debug build will update schemas on push, so don't run if we're on pull request
uses: ./.github/workflows/update_schemas.yml
@ -36,7 +50,7 @@ jobs:
artifact_name: NewHorizons-Schemas-Release
secrets: inherit
Update_Release:
name: 'Create/Update Release Asset'
name: "Create/Update Release Asset"
needs: Build
if: ${{ github.ref != 'refs/heads/main' && contains(github.event.pull_request.labels.*.name, 'update-pr') }}
runs-on: ubuntu-latest
@ -65,5 +79,3 @@ jobs:
artifacts: "xen.NewHorizons.zip"
draft: true
prerelease: false