-
Notifications
You must be signed in to change notification settings - Fork 10
92 lines (89 loc) · 3.36 KB
/
draft_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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Draft Release
on:
workflow_dispatch:
inputs:
tag:
required: true
description: The tag to release (e.g. 1.2.3)
type: string
default: 0.0.0
jobs:
update_version:
runs-on: ubuntu-latest
outputs:
commit_hash: ${{ steps.commit.outputs.commit_hash }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update project and export versions
run: |
sed -i "s/config\/version=.*/config\/version=\"v${{ github.event.inputs.tag }}\"/g" project.godot
sed -i "s/=\"[0-9]\.[0-9]\.[0-9]\"/\"${{ github.event.inputs.tag }}\"/g" export_presets.cfg
- name: Update Changelog
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
with:
tag: ${{ github.event.inputs.tag }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
id: commit
with:
commit_message: "Update version to ${{ github.event.inputs.tag }}"
file_pattern: project.godot export_presets.cfg CHANGELOG.md
build:
uses: Jibby-Games/Flappy-Race/.github/workflows/build.yml@main
needs: update_version
with:
commit_hash: ${{ needs.update_version.outputs.commit_hash }}
draft_release:
runs-on: ubuntu-latest
needs: [update_version, build]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.update_version.outputs.commit_hash }}
- name: Download Windows Build
uses: actions/download-artifact@v4
with:
name: FlappyRace-windows-${{ needs.update_version.outputs.commit_hash }}
path: builds/FlappyRace-${{ github.event.inputs.tag }}-Windows
- name: Download Mac Build
uses: actions/download-artifact@v4
with:
name: FlappyRace-mac-${{ needs.update_version.outputs.commit_hash }}
path: builds/FlappyRace-${{ github.event.inputs.tag }}-Mac
- name: Download Linux Build
uses: actions/download-artifact@v4
with:
name: FlappyRace-linux-${{ needs.update_version.outputs.commit_hash }}
path: builds/FlappyRace-${{ github.event.inputs.tag }}-Linux
- name: Prepare Windows
uses: TheDoctor0/zip-release@0.6.0
with:
filename: FlappyRace-${{ github.event.inputs.tag }}-Windows.zip
path: FlappyRace-${{ github.event.inputs.tag }}-Windows/*
directory: builds/
- name: Prepare Mac
uses: TheDoctor0/zip-release@0.6.0
with:
filename: FlappyRace-${{ github.event.inputs.tag }}-Mac.zip
path: FlappyRace-${{ github.event.inputs.tag }}-Mac/*
directory: builds/
- name: Prepare Linux
uses: TheDoctor0/zip-release@0.6.0
with:
filename: FlappyRace-${{ github.event.inputs.tag }}-Linux.zip
path: FlappyRace-${{ github.event.inputs.tag }}-Linux/*
directory: builds/
- name: Extract Release Notes
uses: ffurrer2/extract-release-notes@v1
id: extract-release-notes
- name: Draft GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.events.inputs.tag }}
name: Flappy Race v${{ github.event.inputs.tag }}
body: ${{ steps.extract-release-notes.outputs.release_notes }}
draft: true
files: |
builds/FlappyRace-*-*.zip