-
Notifications
You must be signed in to change notification settings - Fork 133
51 lines (51 loc) · 1.58 KB
/
check-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 }}