Skip to content

Check Releases

Check Releases #875

Workflow file for this run

name: "Check Releases"
on:
schedule:
- cron: '27 23 * * *'
push:
branches:
- master
jobs:
fetch:
name: Fetch Latest Godot Engine Release
runs-on: ubuntu-20.04
outputs:
release_tag: ${{ steps.parse.outputs.tag }}
steps:
- id: parse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG=$(gh release view --repo godotengine/godot --json tagName --jq .tagName)
echo "tag=$TAG" >> $GITHUB_OUTPUT
current:
name: Fetch Current Godot CI release
runs-on: ubuntu-20.04
outputs:
release_tag: ${{ steps.parse.outputs.tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: parse
run: echo "tag=$(git tag --list --sort=-creatordate | head --lines 1)" >> $GITHUB_OUTPUT
create:
needs: [fetch, current]
name: Create New Godot CI Release
runs-on: ubuntu-20.04
if: needs.fetch.outputs.release_tag != needs.current.outputs.release_tag
steps:
- uses: actions/checkout@v3
- run: gh release view --repo godotengine/godot --json body --jq .body | sed 's/\\r\\n/\n/g' > body.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag ${{ needs.fetch.outputs.release_tag }}
git push
- uses: softprops/action-gh-release@v0.1.14
with:
body_path: body.txt
tag_name: ${{ needs.fetch.outputs.release_tag }}
token: ${{ secrets.PAT }}