-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (81 loc) · 2.43 KB
/
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
name: Release
env:
godot_version: '4.0'
app_name: maze-test
on:
push:
tags:
- v*
jobs:
exports:
name: Export from Godot
strategy:
matrix:
include:
- preset: web
export_file: index.html
- preset: windows
export_file: maze-test.exe
- preset: linux
export_file: maze-test
- preset: macos
export_file: maze-test.zip
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
lfs: true
- name: Set Env Vars
env:
APP_NAME: ${{ env.app_name }}
PRESET: ${{ matrix.preset }}
run: |
version=${GITHUB_REF/refs\/tags\/v/}
echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
echo "package=${APP_NAME}-v${version}-${PRESET}.zip" >> $GITHUB_ENV
- name: Add Build Info
uses: robpc/godot-build-info-action@v1
with:
version: ${{ env.version }}
- name: Export ${{ matrix.preset }} from Godot
uses: robpc/godot-export-action@v4.0.2
with:
preset: ${{ matrix.preset }}
export_path: build/${{ matrix.preset }}/${{ matrix.export_file }}
- name: Bundle ${{ matrix.preset }} export
if: ${{ matrix.preset != 'macos' }}
uses: montudor/action-zip@v0.1.1
with:
args: zip --junk-paths --recurse-paths build/${{ env.package }} build/${{ matrix.preset }}
- name: Copy ${{ matrix.preset }} bundle
if: ${{ matrix.preset == 'macos' }}
uses: canastro/copy-file-action@0.0.2
with:
source: build/${{ matrix.preset }}/${{ matrix.export_file }}
target: build/${{ env.package }}
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: build
path: build/${{ env.package }}
release:
runs-on: ubuntu-latest
needs:
- exports
steps:
- name: Set Env Vars
run: |
echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- uses: actions/download-artifact@v3
with:
name: build
- run: ls -la
- uses: ncipollo/release-action@v1
with:
name: Release v${{ env.version }}
tag: v${{ env.version }}
draft: true # for testing
allowUpdates: true
artifacts: "*.zip"
token: ${{ secrets.GITHUB_TOKEN }}