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

Build and attach {amd,arm}64 binaries to releases #339

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Oct 11, 2023

Completely untested. Cribbed a little from Synapse's CI but kept simple.

I suggest

  1. we commit this to main
  2. I create a draft release pointing at main
  3. We check the CI runs
  4. If anything breaks, discard the release, fix and return to (1)
  5. ???
  6. Profit

I also ran this through https://github.com/rhysd/actionlint which reported no complaints.

Fixes #334.

- run: go build ./cmd/syncv3 -o build/syncv3_linux_${{ matrix.arch }}
env:
GOARCH: ${{ matrix.arch }}
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Synapse uses this. There is the official-looking https://github.com/actions/upload-release-asset, but this has been archived and now recomments softprops' action.

name: "Build and attach binary to release"
on:
release:
types: ["created"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

FTR the types are

  • published
  • unpublished
  • created
  • edited
  • deleted
  • prereleased
  • released

@DMRobertson DMRobertson marked this pull request as ready for review October 11, 2023 13:05
- run: mkdir build
- run: go build -o build/syncv3_linux_${{ matrix.arch }} ./cmd/syncv3
env:
GOARCH: ${{ matrix.arch }}
Copy link
Member

Choose a reason for hiding this comment

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

Technically we should also have GOOS: linux.

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 assumed that would be inherited from the fact that we're running on ubuntu, but I can make that explicit.

@DMRobertson
Copy link
Contributor Author

Let's see how this works in practice.

@DMRobertson DMRobertson merged commit 20c361f into main Oct 11, 2023
7 checks passed
@DMRobertson DMRobertson deleted the dmr/build-binary-for-releases branch October 11, 2023 13:41
@DMRobertson
Copy link
Contributor Author

Oh ffs:

Note: Workflows are not triggered for the created, edited, or deleted activity types for draft releases. When you create your release through the GitHub browser UI, your release may automatically be saved as a draft.

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

@DMRobertson
Copy link
Contributor Author

Which contradicts https://docs.github.com/en/webhooks/webhook-events-and-payloads#release

Action type: created
A draft was saved, or a release or pre-release was published without previously being saved as a draft.

@DMRobertson
Copy link
Contributor Author

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.

Release build artifacts on releases
2 participants