8000 chore: 🤖 improve release action by kodai3 · Pull Request #33 · ubie-oss/ubie-icons · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: 🤖 improve release action #33

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

Merged
merged 6 commits into from
May 6, 2024

Conversation

kodai3
Copy link
Contributor
@kodai3 kodai3 commented Apr 17, 2024

Same release action introduced in the https://github.com/ubie-oss/ubie-ui

@kodai3 kodai3 force-pushed the chore/add-release-action branch from 88221d1 to 29bec14 Compare April 17, 2024 16:03
@takanorip
Copy link
Contributor

@kodai3
I would like you to make 8000 changes so that rather than pushing directly to the main branch, a release pull request is created, and once it is merged, the package is published. Thank you!

kodai3 and others added 5 commits May 6, 2024 15:55
Signed-off-by: kodai3 <k3dai.su3@gmail.com>
Signed-off-by: kodai3 <k3dai.su3@gmail.com>
Signed-off-by: kodai3 <k3dai.su3@gmail.com>
Signed-off-by: kodai3 <k3dai.su3@gmail.com>
Signed-off-by: kodai3 <k3dai.su3@gmail.com>
@kodai3 kodai3 force-pushed the chore/add-release-action branch from d9d3927 to 0930d7d Compare May 6, 2024 06:56
@kodai3
Copy link
Contributor Author
kodai3 commented May 6, 2024

@takanorip
I updated the actions to create PR before publish.
It will work as follows

You can create a PR by workflow dispatch, selecting semver versions
image

Then, PR with what's Changed and diff for package.json and package-lock.json are created
image

When you merge to the main branch, publish.yml will be fired and release to the npm registory.

Copy link
Contributor
@takanorip takanorip left a comment

Choose a reason for hiding this comment

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

🎉

@takanorip takanorip merged commit 776ec82 into ubie-oss:main May 6, 2024
1 check passed

- name: Set GitHub Release Note
id: release_note
uses: actions/github-script@v6
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use actions/github-script@v7


- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use peter-evans/create-pull-request@v6

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
if: steps.tag_check.outputs.exists_tag == 'false'
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems this script is not working properly. Should this condition be set to steps.tag_check.outputs.exists_tag == 'true' ?
https://github.com/ubie-oss/ubie-icons/actions/runs/8985341603/job/24679125682

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it shuold be 'false'.

Because exists_tag is true if the version in the package.json and latest tag's version are aligned, and if so we don't want to release it.

Copy link
Contributor

Choose a reason for hiding this comment

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

That means the reason it's not working properly this time is because the tags and the version in the package.json don't match. At a glance, they seem to match though...

run: npm run build

- name: Release
run: npx release-it -i ${{ github.event.inputs.semver }} --ci
Copy link
Contributor

Choose a reason for hiding this comment

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

This release notes have become a list of commits, so I'd like them to be formatted to match the other release notes.
https://github.com/ubie-oss/ubie-icons/releases/tag/v0.6.2
https://github.com/ubie-oss/ubie-icons/releases/tag/v0.6.1

Copy link
Contributor

Choose a reason for hiding this comment

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

The -i option might not be necessary. I couldn't find any documentation related to this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was using and experimented the base action for repo which uses squash merge, so I didn't notice this pain...

Copy link
Contributor Author
@kodai3 kodai3 May 8, 2024

Choose a reason for hiding this comment

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

The -i option is in fact important. you can find with --help command. It is used to specify the semver version you selected on the workflow dispatch.

npx release-it --help     
Release It! v17.2.1

  Usage: release-it <increment> [options]

  Use e.g. "release-it minor" directly as shorthand for "release-it --increment=minor".

  -c --config            Path to local configuration options [default: ".release-it.json"]
  -d --dry-run           Do not touch or write anything, but show the commands
  -h --help              Print this help
  -i --increment         Increment "major", "minor", "patch", or "pre*" version; or specify version [default: "patch"]
     --ci                No prompts, no user interaction; activated automatically in CI environments
     --only-version      Prompt only for version, no further interaction
  -v --version           Print release-it version number
     --release-version   Print version number to be released
     --changelog         Print changelog for the version to be released
  -V --verbose           Verbose output (user hooks output)
  -VV                    Extra verbose output (also internal commands output)

Comment on lines +6 to +8
"github": {
"release": true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to this. This might work.

  "github": {
    "release": true,
    "autoGenerate": true
  }

Copy link
Contributor Author
@kodai3 kodai3 May 8, 2024

Choose a reason for hiding this comment

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

We cannot rely on this because we don't want to push the tag before merging the PR. (publishing to npm)

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand... 😭

@takanorip
Copy link
Contributor

@kodai3
I'm sorry that the code review wasn't thorough enough.
Please check these comments 🙏

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.

3 participants
0