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

Feature: Automate release flow #45

Merged
merged 6 commits into from
Dec 19, 2024
Merged

Feature: Automate release flow #45

merged 6 commits into from
Dec 19, 2024

Conversation

limbonaut
Copy link
Collaborator

@limbonaut limbonaut commented Dec 13, 2024

Included:

  • Bump version script
  • Craft configuration
  • Package workflow
  • Release workflow

Closes #30

Adapted from sentry-unreal.
@limbonaut limbonaut added the enhancement New feature or request label Dec 13, 2024
@limbonaut limbonaut force-pushed the feat/automate-release branch 12 times, most recently from b8055e5 to a5231b6 Compare December 13, 2024 13:25
@limbonaut limbonaut force-pushed the feat/automate-release branch from 1b6e28b to 3935d88 Compare December 13, 2024 16:40
@limbonaut
Copy link
Collaborator Author

I think this is as close as I could get without actually testing with real tokens and creating a release. craft seems to fail with no tags existing in the repo (git describe fails), so I've been adding a simple tag on the first commit in my tests. This looks like an oversight in craft, but the workaround is trivial.

I can also add registry to the configuration:

  - name: registry
    sdks:
      github:getsentry/sentry-godot:

I'm not sure what else is needed for the registry to work.

@limbonaut limbonaut marked this pull request as ready for review December 16, 2024 13:36
- name: Prepare artifact
shell: bash
run: |
# * Fix crashpad_handler permissions, workaround for https://github.com/actions/upload-artifact/issues/38
Copy link
Member

Choose a reason for hiding this comment

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

Ideally this goes into a script so it's easier to test locally and debug stuff

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It relies on actually downloading an artifact - something that is a merged product of a number of builds. Testing it locally would be cumbersome, since it's not enough to produce a single build for this.

Copy link
Member

Choose a reason for hiding this comment

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

I meant the steps. There are a few commands here that could go in a .sh file and we invoke it from here.

.github/workflows/release.yml Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Add:

Unreleased

This will get replaced with the version

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

Choose a reason for hiding this comment

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

Not showing on the diff yet, did you push it?

scripts/bump-version.ps1 Show resolved Hide resolved
@bruno-garcia
Copy link
Member

I think this is as close as I could get without actually testing with real tokens and creating a release. craft seems to fail with no tags existing in the repo (git describe fails), so I've been adding a simple tag on the first commit in my tests. This looks like an oversight in craft, but the workaround is trivial.

I can also add registry to the configuration:

  - name: registry
    sdks:
      github:getsentry/sentry-godot:

I'm not sure what else is needed for the registry to work.

Release registry requires that we create the first version "by hand".
In this repo:
https://github.com/getsentry/sentry-release-registry

@limbonaut
Copy link
Collaborator Author

This is a test build run in my fork: https://github.com/limbonaut/sentry-godot/actions/runs/12354096820

@limbonaut
Copy link
Collaborator Author

limbonaut commented Dec 16, 2024

Release registry requires that we create the first version "by hand". In this repo: https://github.com/getsentry/sentry-release-registry

In such a case, we can add it later, after the first release and adding this metadata "by hand".

Or should we create the first sentry-godot release by hand?

- name: Prepare artifact
shell: bash
run: |
# * Fix crashpad_handler permissions, workaround for https://github.com/actions/upload-artifact/issues/38
Copy link
Member

Choose a reason for hiding this comment

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

I meant the steps. There are a few commands here that could go in a .sh file and we invoke it from here.

Copy link
Member

Choose a reason for hiding this comment

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

Not showing on the diff yet, did you push it?

changelogPolicy: auto
preReleaseCommand: pwsh scripts/bump-version.ps1
targets:
- name: github
Copy link
Member

Choose a reason for hiding this comment

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

Since we're not using release registry here, this PR is unblocked.

On a follow up PR, we can add a new target, like this:
https://github.com/getsentry/sentry-unreal/blob/4027d198c6ab87016d95665fcf9af1df3cac4a31/.craft.yml#L12-L13

But basically as:

  - name: registry
    sdks:
      github:getsentry/sentry-godot:

That is, once this is merged: getsentry/sentry-release-registry#174

@bruno-garcia bruno-garcia merged commit 2ea6be3 into main Dec 19, 2024
13 checks passed
@bruno-garcia bruno-garcia deleted the feat/automate-release branch December 19, 2024 01:05
@bruno-garcia
Copy link
Member

I merged to test it out since it requires approval anyway once a release is triggered.

Triggering here as 0.0.1 (since we're not pushing to the release registry yet, since I already created 0.0.1 there).

Run: https://github.com/getsentry/sentry-godot/actions/runs/12404236789/job/34629077725

But failed with:

[info] Releasing version 0.0.1 from main
[info] Preparing to release the version: 0.0.1
[info] Created a new release branch: "release/0.0.1"
[info] Switched to branch "release/0.0.1"
Error:  fatal: No names found, cannot describe anything.

  
  at Object.action (/usr/local/bin/craft:357:10622)
  at fPe.exec (/usr/local/bin/craft:357:10934)
  at /usr/local/bin/craft:356:6689
  at new Promise (<anonymous>)
  at bS.handleTaskData (/usr/local/bin/craft:356:6578)
  at bS.<anonymous> (/usr/local/bin/craft:356:6204)
  at Generator.next (<anonymous>)
  at a (/usr/local/bin/craft:353:1502)
  at process.processTicksAndRejections (node:internal/process/task_queues:[95](https://github.com/getsentry/sentry-godot/actions/runs/12404236789/job/34629077725#step:4:101):5)
Error: Process completed with exit code 1.

Seems to be described on this issue:

this is not so simple -- the prepare scripts pass the previous version string to the script hooks. so there must be something for those. the quick start guide currently recommends tagging the first commit as 0.0.0

I'll create a dummy tag: https://github.com/getsentry/sentry-godot/releases/tag/0.0.0

Rerunning the workflow: https://github.com/getsentry/sentry-godot/actions/runs/12404236789

Approval issue created: getsentry/publish#4791
Approved

version going from 0.1.0-dev to 0.0.1 which is fine for this test: 2ea6be3...refs/heads/release/0.0.1

Release logs: https://github.com/getsentry/publish/actions/runs/12404320280/job/34629296353

Failed: getsentry/publish#4791 (comment)
Need to debug this

@limbonaut
Copy link
Collaborator Author

Failed: getsentry/publish#4791 (comment) Need to debug this

See comment getsentry/publish#4791 (comment)

@limbonaut limbonaut mentioned this pull request Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate release flow
2 participants