-
Notifications
You must be signed in to change notification settings - Fork 2
152 lines (131 loc) · 4.33 KB
/
Copy pathrelease.yml
File metadata and controls
152 lines (131 loc) · 4.33 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Build and Release
on:
push:
tags:
- 'v*.*.*'
env:
GODOT_VERSION: 4.5.0
GODOT_MONO_VERSION: 4.5.0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
export_name: "OpenChamp_Linux_Server"
preset: "Linux Server"
artifact_ext: ""
- os: windows-latest
export_name: "OpenChamp_Win_Server.exe"
preset: "Win Server(x86)"
artifact_ext: ".exe"
- os: macos-latest
export_name: "OpenChamp_MacOS_Server.app"
preset: "Mac Server (universal)"
artifact_ext: ".app"
- os: windows-latest
export_name: "OpenChamp_Windows_Desktop.exe"
preset: "Windows Desktop"
artifact_ext: ".exe"
- os: macos-latest
export_name: "OpenChamp_macOS_Desktop.dmg"
preset: "macOS"
artifact_ext: ".dmg"
- os: ubuntu-latest
export_name: "OpenChamp_Linux_Desktop"
preset: "Linux"
artifact_ext: ""
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Godot
uses: chickensoft-games/setup-godot@v2
with:
version: ${{ env.GODOT_VERSION }}
use-mono: false
include-templates: true
- name: Create export output directory
run: mkdir -p build/exports
- name: Build Godot project
run: |
godot --headless --export-release "${{ matrix.preset }}" "build/exports/${{ matrix.export_name }}"
- name: Package build output
run: |
cd build/exports
if [[ "${{ runner.os }}" == "Windows" ]]; then
7z a -r "${{ matrix.export_name }}.zip" "${{ matrix.export_name }}"
else
tar -czf "${{ matrix.export_name }}.tar.gz" "${{ matrix.export_name }}"
fi
shell: bash
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.export_name }}
path: build/exports/${{ matrix.export_name }}*
retention-days: 1
generate-release-notes:
needs: build
runs-on: ubuntu-latest
outputs:
release_notes: ${{ steps.generate.outputs.release_notes }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Release Notes
id: generate
run: |
# Get the tag name
TAG="${{ github.ref }}"
TAG="${TAG#refs/tags/}"
# Get the previous tag
PREVIOUS_TAG=$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null || echo "")
# Generate changelog
if [ -z "$PREVIOUS_TAG" ]; then
CHANGELOG=$(git log --pretty=format:"- %s (%an)" --no-merges)
else
CHANGELOG=$(git log "${PREVIOUS_TAG}..${TAG}" --pretty=format:"- %s (%an)" --no-merges)
fi
# Create release notes
RELEASE_NOTES="# Release ${TAG}
## Changes
${CHANGELOG}
## Downloads
All builds are attached to this release."
# Output to file and env
echo "$RELEASE_NOTES" > release_notes.md
echo "release_notes<<EOF" >> $GITHUB_OUTPUT
echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Upload release notes artifact
uses: actions/upload-artifact@v4
with:
name: release-notes
path: release_notes.md
retention-days: 1
create-release:
needs: [build, generate-release-notes]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: release-artifacts/**/*
body_path: release-artifacts/release-notes/release_notes.md
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_REPOSITORY: ${{ github.repository }}