-
Notifications
You must be signed in to change notification settings - Fork 57
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(action): Rework action to be a composite action #243
Conversation
02af32a
to
aa35025
Compare
aa35025
to
13bddeb
Compare
…itten on the CI by the install step
@@ -0,0 +1,35 @@ | |||
# Releases always publish a `v[major].[minor].[patch]` tag | |||
# This action creates/updates `v[major]` and `v[major].[minor]` tags | |||
name: Create release tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need special handling for pre-releases here? this should not run for those I guess. Ideally we only run this if the version matches ^(\d+)\.(\d+)\.(\d+)$
, I suppose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The action does not trigger on pre-releases, I figured we don't need extra tags for those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, if that is the case, then all good!
.github/workflows/test.yml
Outdated
- uses: './.github/actions/use-local-dockerfile' | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary? do we need all commits here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a recommendation we give when using the action, probably because of set-commits
. I suppose for the tests we don't need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Co-authored-by: Francesco Gringl-Novy <[email protected]>
action.yml
Outdated
|
||
- name: Install Sentry CLI v2 | ||
shell: bash | ||
run: yarn add @sentry/cli@2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: For a follow up, let's allow to make this configurable as an input (optionally) so you can pick a specific version here!
m: Also, how does that work with caching & new cli versions? We should ensure that new v2 versions are used. Probably, we should cache yarn including the used sentry-cli version here? 🤔 and use npm view @sentry/cli version
to get the latest v2 version here, somehow...?
Finally, instead of yarn add
let's use yarn add @sentry/cli --no-lockfile --dev
to avoid actually mutating the lockfile here, we do not care about this I'd say? that should also silence the warning for double installing this...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right.. I removed the caching again because it doesn't make sense when installing the cli on the ci and we can't possibly commit the lockfile back.
Replaced yarn add
with yarn add --dev --no-lockfile @sentry/cli@2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good and love the reduction in runtime!
Had a couple of questions but I think this is a great improvement!
Let's also make sure we document the new release flow properly so that future contributors know what to do. (if this is already done, even better; just didn't see anything in this PR)
MINOR_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d. -f1-2) | ||
git tag -f $MAJOR_VERSION | ||
git tag -f $MINOR_VERSION | ||
git push -f origin $MAJOR_VERSION $MINOR_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a question: this already handles previously set and pushed tags when we associate them with new commits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, tags will be force updated and force pushed so e.g. the v1
tag will be updated to point to the tag from the craft release e.g. v1.5.4
action.yml
Outdated
|
||
- name: Install Sentry CLI v2 | ||
shell: bash | ||
run: yarn add @sentry/cli@2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m: Have you thought about pinning the CLI version? Can we read it from dev dependencies? In the bundler plugins we pin it. I think it would be good to associate a specific release of the action with a specific CLI version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I debatted pinning the version but people rarely upgrade their github actions and I figured it would be good to at least receive patches for sentry-cli.
I changed this to ~2.4
and in a follow up we might want to have this configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point that this isn't necessarily the same situation. I'm a bit concerned that this then still doesn't give us consistent behaviour for one action version but we can still change this later on if we ever receive bug reports. No objections to going with ^2.4 or ~2.4 then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
c671e2c
to
c3e1fdc
Compare
fcaeb81
to
ea32e3d
Compare
e7f8815
to
d4aaaaa
Compare
e5f8a48
to
7f9cbfc
Compare
src/main.ts
Outdated
const workingDirectory = options.getWorkingDirectory(); | ||
const currentWorkingDirectory = process.cwd(); | ||
|
||
if (workingDirectory !== null && workingDirectory.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: Can this just be if (workingDirectory)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
7a80e3e
to
32140db
Compare
@sentry/cli
so it can be installed per-runnerCloses: #185, #193, #233