-
Notifications
You must be signed in to change notification settings - Fork 368
59 lines (50 loc) · 1.83 KB
/
upload-release.yml
File metadata and controls
59 lines (50 loc) · 1.83 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
# Update the loader version on the Index
name: Upload Release Info
on:
# trigger when a new release is released
release:
types:
- published
workflow_dispatch:
jobs:
publish:
name: Upload Release Info
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch release info
uses: actions/github-script@v7
id: fetch-release
with:
result-encoding: string
script: |
const releases = await github.rest.repos.listReleases({
owner: "${{ github.repository_owner }}",
repo: "${{ github.event.repository.name }}",
per_page: 2
});
const release = releases.data.find((r) => r.tag_name != "nightly");
if (!release) {
throw new Error("Could not identify a non nightly release");
}
core.setOutput("PRERELEASE", release.prerelease);
core.setOutput("TAG", release.tag_name);
- name: Generate release data
id: release-data
run: python ${{ github.workspace }}/.github/scripts/parse-release.py
- name: Create release
shell: bash
run: |
CODE=`curl -d '{"prerelease": ${{ steps.fetch-release.outputs.PRERELEASE }}, "commit_hash": "${{ github.sha }}", "tag": "${{ steps.fetch-release.outputs.TAG }}", "gd": ${{ steps.release-data.outputs.PLATFORM_INFO }}}' \
--write-out "%{http_code}" \
--silent \
--output /dev/null \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.GEODE_INDEX_TOKEN }}" \
"https://api.geode-sdk.org/v1/loader/versions"`
if [ $CODE != "204" ]
then
echo "Request failed with response $CODE"
exit 1
fi