diff --git a/.github/workflows/publish_addon.yml b/.github/workflows/publish_addon.yml index aed5f8d..733d693 100644 --- a/.github/workflows/publish_addon.yml +++ b/.github/workflows/publish_addon.yml @@ -9,23 +9,40 @@ jobs: publish_addon: name: Publish Addon runs-on: ubuntu-latest + permissions: + contents: write steps: - - name: Install Dependencies - run: sudo apt-get install -y zip + - 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: | + rsync -Rr . ./addon + zip -r GodotAnnotate.zip ./addon -x "**/.*/*" + ls -R - - name: Create Addon Folder - run: | - rsync -Rr . ./addon - zip -r GodotAnnotate.zip ./addon + - name: Retrieve Release + id: retrieve_release + uses: octokit/request-action@v2.x + 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" + - 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"