ipld / go-car

A content addressible archive utility
Other
153 stars 44 forks source link

The release workflow doesn't work #536

Open suzuki-shunsuke opened 1 month ago

suzuki-shunsuke commented 1 month ago

As of v2.14.0, go-car hasn't released pre built binaries.

https://github.com/ipld/go-car/releases/tag/v2.14.0 https://github.com/ipld/go-car/releases/tag/v2.14.1

image

Seems like the GitHub Actions workflow doesn't work.

https://github.com/ipld/go-car/actions/workflows/release-binaries.yml

image
suzuki-shunsuke commented 1 month ago

The workflow releaser.yml creates GitHub Releases.

https://github.com/ipld/go-car/blob/92d3f4e5cc6eadb2223959365be208b73d190ac7/.github/workflows/releaser.yml#L17

I think you would expect that the workflow release-binaries.yml is triggered by publishing releases, but actually the workflow wasn't triggered because releases were created by GitHub Actions token.

https://github.com/ipdxco/unified-github-workflows/blob/61bc2a929b1a896da9559d6c4b14c574425da364/.github/workflows/releaser.yml#L152C22-L152C46

GitHub Actions token doesn't trigger new workflow runs.

https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run.

So to trigger new workflow runs, you have to use a GitHub personal access token or GitHub App token instead. The reusable workflow ipdxco/unified-github-workflows/.github/workflows/releaser.yml accepts a GitHub Access token UCI_GITHUB_TOKEN, so you can pass a GitHub personal access token but can't pass GitHub App token.

https://github.com/ipdxco/unified-github-workflows/blob/61bc2a929b1a896da9559d6c4b14c574425da364/.github/workflows/releaser.yml#L21-L23

rvagg commented 1 month ago

noted in https://github.com/ipld/go-car/pull/532#issuecomment-2339637334, but I don't have a solution; it could be that the releaser job needs a Go upgrade to match: https://github.com/ipld/go-car/blob/master/.github/workflows/release-binaries.yml strangely there's no errors from running it, it just doesn't seem to want to trigger since its last run for 2.13.1 https://github.com/ipld/go-car/actions/runs/6096867926

suzuki-shunsuke commented 1 month ago

The release v2.13.1 was created by you.

image

On the other hand, v2.14.0 and v2.14.1 were created by GitHub Actions token.

image

That's why the releaser workflow wasn't triggered.

https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run.

rvagg commented 1 month ago

Ahhh, you're right - I've always done the v2.x releases manually, leaving the version.json bump auto-release for the v0.x releases.

Attempting to fix with https://github.com/ipld/go-car/pull/540