-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (44 loc) · 1.51 KB
/
publish_addon.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
name: Godot Annotate
run-name: ${{ github.ref_name }} Publish
on:
release:
types: [published]
jobs:
publish_addon:
name: Publish Addon
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repo
id: checkout_repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Dependencies
run: sudo apt-get install -y zip
- name: Create Addon Folder
run: |
mkdir -p ${{ github.sha }}/addons
rsync -Rr . ${{ github.sha }}/addons/GodotAnnotate
rm -r ${{ github.sha }}/addons/GodotAnnotate/${{ github.sha }}
zip -r GodotAnnotate.zip ./${{ github.sha }}/addons/GodotAnnotate -x "**/.*/*"
ls -R
- name: Retrieve Release
id: retrieve_release
uses: octokit/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
route: GET /repos/${{ github.repository }}/releases/tags/${{ github.ref_name }}
- name: Upload Asset
id: upload_asset
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/octet-stream" \
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ fromJson(steps.retrieve_release.outputs.data).id }}/assets?name=GodotAnnotate.zip" \
--data-binary "@./GodotAnnotate.zip"