pfnet / pysen

Python linting made easy. Also a casual yet honorific way to address individuals who have entered an organization prior to you.
MIT License
487 stars 20 forks source link

Use 'release' event to trigger release workflow #16

Closed bonprosoft closed 2 years ago

bonprosoft commented 2 years ago

There is a limitation that a workflow cannot trigger a new workflow. https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow

Currently, a release is created by release-drafter, and that's why the release workflow wasn't triggered for the 0.10.2 tag.

As such, I configured the release workflow to use the workflow_dispatch to publish a new release. I also removed push.tags trigger as we can use the workflow_dispatch trigger for the manual release as well, but I don't have a strong opinion about that.

himkt commented 2 years ago

I may miss some context, but let me ask a question: can we use release event to trigger the workflow? Release drafter seemingly creates a pre-release, which makes me wonder if it's possible to trigger the release workflow by release event (with activity == published that is distinguished from releases created by drafter).

🔗 https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release

[updated]

Sorry, I was wrong. To distinguish releases from prereleases, we may need to check github.event.release.prerelease flag instead of activity.

🔗 https://github.community/t/release-prerelease-action-triggers/17275/2

bonprosoft commented 2 years ago

Thank you for your review, @himkt! I've updated my PR to use the release event as you suggest.

release-drafter creates a release and save it as a draft after a PR is merged, so I don't think we need to distinguish between releases and pre-releases.