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: release automation #130

Merged
merged 1 commit into from
Sep 10, 2022
Merged

chore: release automation #130

merged 1 commit into from
Sep 10, 2022

Conversation

simoneb
Copy link
Contributor

@simoneb simoneb commented Sep 10, 2022

Adds https://github.com/nearform/optic-release-automation-action and takes the chance to refactor the existing CI script, which was unnecessarily complex.

- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: pnpm
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the simplification overall boils down to this. setup-node natively supports caching pnpm, so there's no need for a custom setup

Comment on lines +2 to +6
on:
push:
branches:
- main
pull_request:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the recommended setup to avoid running this workflow too many times.

Comment on lines +31 to +32
npm-token: ${{ secrets[format('NPM_TOKEN_{0}', github.actor)] || secrets.NPM_TOKEN }}
optic-token: ${{ secrets[format('OPTIC_TOKEN_{0}', github.actor)] || secrets.OPTIC_TOKEN }}
Copy link
Contributor Author

@simoneb simoneb Sep 10, 2022

Choose a reason for hiding this comment

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

these secrets need to be set up in the repo and a decision needs to be made about who can release.

Copy link
Member

Choose a reason for hiding this comment

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

The OPTIC_TOKEN is not required if I use an npm publish token right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct. the npm automation token allows you to bypass 2FA. if you want to go that way the release process is simpler (though less secure of course). you would still need to decide whether to have a single NPM token or one per person who can release. the second option allows to restrict who can release to only the people who have a NPM_TOKEN_{username} configured in the repo secrets

Copy link
Member

Choose a reason for hiding this comment

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

Perfect, I already set up an NPM_TOKEN for the next release. Next week we'll catch up to decide who has the rights to make a release, thanks a lot for this PR

@simoneb simoneb marked this pull request as ready for review September 10, 2022 10:40
@simoneb simoneb force-pushed the chore/release-automation branch from 016f73d to b3d299e Compare September 10, 2022 10:43
@micheleriva micheleriva merged commit 0a55ea8 into main Sep 10, 2022
@micheleriva micheleriva deleted the chore/release-automation branch September 10, 2022 10:52
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.

2 participants