Skip to content

Commit

Permalink
update github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bbkane committed Nov 25, 2021
1 parent 465067c commit 2e9b3cc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/gorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
Expand All @@ -16,7 +20,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
go-version: 1.17

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand All @@ -26,4 +30,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEY_GITHUB_GORELEASER_TO_HOMEBREW_TAP: ${{ secrets.KEY_GITHUB_GORELEASER_TO_HOMEBREW_TAP }}

33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,36 @@ Basically a replacement to GNU Stow for my use cases:
- add --script filename.sh flag that prints out an equivalent bash script to a file
- reconsider relative symlinks to be more stow compatible? Maybe with --type relative|absolute flag?
- README!

# goreleaser notes

## locally

Need to release with an unpushed new tag each time. Otherwise you get an error like:

```
⨯ release failed after 1.62s error=scm releases: failed to publish artifacts: failed to upload checksums.txt after 1 tries: POST https://uploads.github.com/repos/bbkane/fling/releases/54053584/assets?name=checksums.txt: 422 Validation Failed [{Resource:ReleaseAsset Field:name Code:already_exists Message:}]
```
Need to export GITHUB_TOKEN and KEY_GITHUB_GORELEASER_TO_HOMEBREW_TAP (see KeePassXC)

```
$ goreleaser release --rm-dist
```

Now that a local release is working, I'll try the CI/CD to avoid the following error?

```
⨯ release failed after 31.30s error=homebrew tap formula: failed to publish artifacts: PUT https://api.github.com/repos/bbkane/homebrew-tap/contents/Formula/fling.rb: 404 Not Found []
```

Still got it. I updated the repo secret to be obviously wrong. Let's see if the error message changes.

```
⨯ release failed after 15.99s error=homebrew tap formula: failed to publish artifacts: GET https://api.github.com/repos/bbkane/homebrew-tap/contents/Formula/fling.rb: 401 Bad credentials []
```

So that wasn't it...

Looking at the previous release, when I GET that file I don't get a 404 lile goreleaser says it does - https://api.github.com/repos/bbkane/homebrew-tap/contents/Formula/fling.rb

https://goreleaser.com/ci/actions/ - adding permissions to the job

0 comments on commit 2e9b3cc

Please sign in to comment.