-
Notifications
You must be signed in to change notification settings - Fork 7
178 lines (160 loc) · 5.58 KB
/
publish.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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Release
on:
push:
branches:
- main
jobs:
addon:
name: ${{ matrix.config.name }}
runs-on: ubuntu-latest
#environment: asset-library
strategy:
fail-fast: false
matrix:
config:
- {
id: "aspect_ratio_resize_container",
id-name: "aspect_ratio_resize_container",
name: "AspectRatioResizeContainer",
asset-id: "2089",
}
- {
id: "custom_theme_overrides",
id-name: "custom_theme_overrides",
name: "Custom Theme Overrides",
asset-id: "2091",
}
- {
id: "git_sha_project_setting",
id-name: "git_sha_project_setting",
name: "Git SHA Project Setting",
asset-id: "1979",
}
- {
id: "glogging",
id-name: "glogging",
name: "GLogging",
asset-id: "no-deploy",
}
- {
id: "hide_private_properties",
id-name: "hide_private_properties",
name: "Hide Private Properties",
asset-id: "1989",
}
- {
id: "icon_explorer",
id-name: "icon_explorer",
name: "Icon Explorer",
asset-id: "2511",
}
- {
id: "icons_patcher",
id-name: "icons_patcher",
name: "Icons Patcher",
asset-id: "1980",
}
- {
id: "licenses",
id-name: "licenses",
name: "License Manager",
asset-id: "1969",
}
- {
id: "kenyoni/plugin_reloader",
id-name: "plugin_reloader",
name: "Plugin Reloader",
asset-id: "no-deploy",
}
- {
id: "qr_code",
id-name: "qr_code",
name: "QR Code",
asset-id: "2090",
}
- {
id: "texture_button_colored",
id-name: "texture_button_colored",
name: "TextureButtonColored",
asset-id: "2092",
}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: Update environment
run: |
sudo apt update -qq
sudo apt install -y golang
- name: Checkout
uses: actions/checkout@v3
- name: Fix git ownership
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Prepare artifacts
id: "prepare-artifacts"
working-directory: publisher
run: |
go run . zip -b ../ -a ${{ matrix.config.id }} -o ../archives/
go run . github -b ../ -a ${{ matrix.config.id }} -o $GITHUB_OUTPUT
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.name }}
path: archives/${{ matrix.config.id-name }}-*.zip
- uses: mukunku/[email protected]
id: checkTag
with:
tag: ${{ matrix.config.id-name }}-${{ steps.prepare-artifacts.outputs.version }}
- name: Prepare Release
if: ${{ steps.checkTag.outputs.exists == 'false' }}
run: |
git config user.name github-actions
git config user.email [email protected]
git tag ${{ matrix.config.id-name }}-${{ steps.prepare-artifacts.outputs.version }}
git push origin tag ${{ matrix.config.id-name }}-${{ steps.prepare-artifacts.outputs.version }}
# wait 5s that the pushed tag is available in the next step, sometimes the next step saw only the local tag
- name: Wait 5s
run: sleep 5s
shell: bash
- name: Deploy to GitHub Release
if: ${{ steps.checkTag.outputs.exists == 'false' }}
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release create ${{ matrix.config.id-name }}-${{ steps.prepare-artifacts.outputs.version }} ./archives/* --title "${{ matrix.config.name }} ${{ steps.prepare-artifacts.outputs.version }}" --notes "${{ steps.prepare-artifacts.outputs.notes }}"
#- name: Deploy to Godot Asset Library
# if: ${{ matrix.config.asset-id != 'no-deploy' }}
# working-directory: publisher
# run: |
# go run . asset-library -b ../ -a ${{ matrix.config.id }} -u "${{ secrets.GD_ASSET_LIBRARY_USER }}" -p "${{ secrets.GD_ASSET_LIBRARY_PASSWORD }}" --asset-id "${{ matrix.config.asset-id }}"
combined-release:
name: Combined Release
runs-on: ubuntu-latest
needs:
- addon
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: Checkout
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: archives
- name: Prepare Release
run: |
find archives/ -type f -print0 | xargs -0 mv -t archives
git config user.name github-actions
git config user.email [email protected]
git tag latest
git push -f origin tag latest
- name: Release
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NOTES: |
Providing the latest release of all addons at one place.
This release tag is continuously updated.
run: |
output=$(gh release delete latest -y 2>&1) || [[ "${output}" == "release not found" ]]
gh release create latest ./archives/*.zip --latest --title "Latest Release" --notes "${{ env.NOTES }}" --target ${{ github.sha }}