Skip to content

Commit 985b7bf

Browse files
committed
fix(ci): grant contents:write for release asset uploads
GITHUB_TOKEN could not attach binaries to GitHub Releases (Resource not accessible by integration). Use softprops/action-gh-release and fix Go cache path.
1 parent 5b70bd2 commit 985b7bf

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

.github/workflows/dev-release.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Build-n-Release Dev (manual)
22

3+
permissions:
4+
contents: write
5+
36
on:
47
workflow_dispatch:
58
inputs:
@@ -46,6 +49,7 @@ jobs:
4649
uses: actions/setup-go@v6
4750
with:
4851
go-version-file: src/go.mod
52+
cache-dependency-path: src/go.sum
4953

5054
- name: Set up Node.js
5155
uses: actions/setup-node@v5
@@ -184,19 +188,17 @@ jobs:
184188
185189
- name: Upload release
186190
if: ${{ github.event_name == 'release' || inputs.release }}
187-
uses: boxpositron/upload-multiple-releases@1.0.7
188-
env:
189-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
191+
uses: softprops/action-gh-release@v2
190192
with:
191-
release_config: |
192-
homer-core_${{ matrix.goarch }}
193-
homer-core*.deb
194-
homer-core*.rpm
195193
tag_name: ${{ env.VERSION }}
196-
release_name: ${{ env.VERSION }}
194+
name: ${{ env.VERSION }}
197195
draft: false
198196
prerelease: false
199-
overwrite: true
197+
overwrite_files: true
198+
files: |
199+
homer-core_${{ matrix.goarch }}
200+
homer-core_${{ env.VERSION }}_${{ matrix.goarch }}.deb
201+
homer-core_${{ env.VERSION }}_${{ matrix.goarch }}.rpm
200202
201203
- name: Upload package artifacts (Packagecloud job)
202204
if: ${{ github.event_name == 'release' || inputs.release }}

.github/workflows/release.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Build-n-Release
22

3+
permissions:
4+
contents: write
5+
36
on:
47
workflow_dispatch:
58
inputs:
@@ -47,6 +50,7 @@ jobs:
4750
uses: actions/setup-go@v6
4851
with:
4952
go-version-file: src/go.mod
53+
cache-dependency-path: src/go.sum
5054

5155
- name: Set up Node.js
5256
uses: actions/setup-node@v5
@@ -189,19 +193,17 @@ jobs:
189193
190194
- name: Upload release
191195
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.release) }}
192-
uses: boxpositron/upload-multiple-releases@1.0.7
193-
env:
194-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
196+
uses: softprops/action-gh-release@v2
195197
with:
196-
release_config: |
197-
homer-core_${{ matrix.goarch }}
198-
homer-core*.deb
199-
homer-core*.rpm
200198
tag_name: ${{ env.VERSION }}
201-
release_name: ${{ env.VERSION }}
199+
name: ${{ env.VERSION }}
202200
draft: false
203201
prerelease: false
204-
overwrite: true
202+
overwrite_files: true
203+
files: |
204+
homer-core_${{ matrix.goarch }}
205+
homer-core_${{ env.VERSION }}_${{ matrix.goarch }}.deb
206+
homer-core_${{ env.VERSION }}_${{ matrix.goarch }}.rpm
205207
206208
- name: Upload package artifacts (Packagecloud job)
207209
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.release) }}

0 commit comments

Comments
 (0)