Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add release workflow #123

Merged
merged 2 commits into from
Jul 3, 2024
Merged

Conversation

timfish
Copy link
Contributor

@timfish timfish commented Jul 3, 2024

Ref #122

release-please.yml is copied straight from here:
https://github.com/nodejs/node-addon-api/blob/main/.github/workflows/release-please.yml

For this to actually work it needs Github credentials that can create PRs that trigger other workflows. The default GITHUB_TOKEN cannot do this.
https://github.com/googleapis/release-please-action?tab=readme-ov-file#github-credentials

We also need an NPM token added to the secrets so it can publish.

@jsumners-nr
Copy link
Contributor

The tool supports changing the log type to use the GitHub API - https://github.com/googleapis/release-please/blob/main/docs/customizing.md#changelog-types

@timfish
Copy link
Contributor Author

timfish commented Jul 3, 2024

The tool supports changing the log type to use the GitHub API

Ah nice. Do you know where this setting goes? It's not immediately obvious!

EDIT
Found it. Their number of options were getting out of hand so now there's a manifest file!

@timfish timfish changed the title chore: Add release workflow and changelog chore: Add release workflow Jul 3, 2024
Copy link
Contributor

@jsumners-nr jsumners-nr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@timfish
Copy link
Contributor Author

timfish commented Jul 3, 2024

Who do we need to ping to get the correct tokens added to the repo secrets? If we do that before this is merged it should create a release PR!

@anonrig
Copy link
Member

anonrig commented Jul 3, 2024

Who do we need to ping to get the correct tokens added to the repo secrets? If we do that before this is merged it should create a release PR!

@bengl @mhdawson can you add the repo secret to land this?

@mhdawson
Copy link
Member

mhdawson commented Jul 3, 2024

@legendecas any chance you could help with adding the token since you did it recently for the node-addon-api repo and can probably do it faster than me?

@legendecas
Copy link
Member

any chance you could help with adding the token since you did it recently for the node-addon-api repo and can probably do it faster than me?

done. Added NPM_TOKEN repository secret granular token, expiring on July 31, 2025.

@timfish
Copy link
Contributor Author

timfish commented Jul 3, 2024

Perfect, I think we just need a Github token now unless that has been added too?

@legendecas
Copy link
Member

GITHUB_TOKEN is automatically generated: https://docs.github.com/en/actions/security-guides/automatic-token-authentication.

I think this should be ready.

@timfish
Copy link
Contributor Author

timfish commented Jul 3, 2024

GITHUB_TOKEN is automatically generated

It is automatically generated, but if PRs are created with that token, workflows don't run on them.

The release-please docs cover this and I've seen this issue on other repositories.

By default, Release Please uses the built-in GITHUB_TOKEN secret. However, all resources created by release-please (release tag or release pull request) will not trigger future GitHub actions workflows, and workflows normally triggered by release.created events will also not run.

You will want to configure a GitHub Actions secret with a Personal Access Token if you want GitHub Actions CI checks to run on Release Please PRs.

Githubs own docs also mention this:

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs.

Although now I'm looking at other PRs created by release-please in other Node org repos, workflows aren't running in those so maybe there's no need for workflows to run in the release PRs?

I'll merge this and it can be added later if it's a problem!

@timfish timfish merged commit 5f31f8d into nodejs:main Jul 3, 2024
48 checks passed
@timfish timfish deleted the chore/release-workflow branch July 3, 2024 21:39
@timfish
Copy link
Contributor Author

timfish commented Jul 3, 2024

So the PR has been created but the workflow hasn't run so there's no way to merge it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants