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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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

permissions:
contents: write # to upload the binaries to the release
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: ["amd64", "arm64"]
kegsay marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.20"
- run: mkdir build
- run: go build ./cmd/syncv3 -o build/syncv3_linux_${{ matrix.arch }}
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.

- 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.

with:
files: build/syncv3_linux_${{ matrix.arch }}
fail_on_unmatched_files: true
Loading