-
-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (96 loc) · 3.28 KB
/
util_upload_release_binaries.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: 📈 Upload new draft artifacts
on:
workflow_dispatch:
# Stop the same workflow actions
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
get_version:
name: Get the current version
runs-on: ubuntu-24.04
outputs:
version: ${{steps.getversion.outputs.version}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: src/version.h
- name: Get library version
id: getversion
shell: bash
env:
REF: ${{github.ref_name}}
run: |
# Get lib version
source_file="src/version.h"
major=$(grep -oP '(?<=#define GQOI_MAJOR )\d+' "$source_file")
minor=$(grep -oP '(?<=#define GQOI_MINOR )\d+' "$source_file")
patch=$(grep -oP '(?<=#define GQOI_PATCH )\d+' "$source_file")
version_string="$major.$minor.$patch"
echo "version=$version_string" >> $GITHUB_OUTPUT
echo "Library Version found in file \`version.h\`: \`$version_string\`" >> $GITHUB_STEP_SUMMARY
create_release_artifact:
name: Create release artifact
needs: get_version
runs-on: ubuntu-24.04
outputs:
zipname: ${{steps.zip.outputs.zipname}}
env:
ADDON_FOLDER_NAME: godot_qoi
ADDON_ROOT_FOLDER_NAME: godot_qoi-${{needs.get_version.outputs.version}}
RELEASE_PREFIX_NAME: godot-qoi
DOWNLOAD_ARTIFACT_NAME: .gdextension_libs_production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
path: ${{env.ADDON_ROOT_FOLDER_NAME}} # godot asset library by default skips root folder
sparse-checkout: |
addons
sparse-checkout-cone-mode: false
- name: Download Binaries
uses: dawidd6/action-download-artifact@v6
with:
workflow: gdextension_build.yml
branch: ${{github.ref_name}}
name: ${{env.DOWNLOAD_ARTIFACT_NAME}}
name_is_regexp: false
search_artifacts: true
skip_unpack: false
path: ${{env.ADDON_ROOT_FOLDER_NAME}}/addons/${{env.ADDON_FOLDER_NAME}}/libs
#event: workflow_dispatch
- name: Create ZIP archive
id: zip
run: |
zipname="${{env.RELEASE_PREFIX_NAME}}_${{needs.get_version.outputs.version}}.zip"
zip -r $zipname ${{env.ADDON_ROOT_FOLDER_NAME}}/addons
echo "zipname=$zipname" >> $GITHUB_OUTPUT
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{steps.zip.outputs.zipname}}
retention-days: 7
path: ${{steps.zip.outputs.zipname}}
upload_github_draft:
name: Upload GitHub draft
needs:
- get_version
- create_release_artifact
runs-on: ubuntu-24.04
steps:
- name: Download Binaries
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Upload Draft Assets
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{needs.get_version.outputs.version}}
files: ${{needs.create_release_artifact.outputs.zipname}}
generate_release_notes: true
append_body: true
fail_on_unmatched_files: true