Skip to content

Commit

Permalink
Merge branch 'dmr/build-binary-for-releases'
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Oct 11, 2023
2 parents 20c361f + 3b14c05 commit a9f4ba4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Build and attach binary to release"
name: "Create draft release with binaries after tag"
on:
release:
types: ["created"]
push:
tags: ["v*"]
permissions:
contents: write # to upload the binaries to the release
jobs:
Expand All @@ -17,11 +17,24 @@ jobs:
with:
go-version: "1.20"
- run: mkdir build
- run: go build -o build/syncv3_linux_${{ matrix.arch }} ./cmd/syncv3
- run: go build -o build/syncv3_${{ matrix.os }}_${{ matrix.arch }} ./cmd/syncv3
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
- name: "Upload binary as artifact"
uses: actions/upload-artifact@v3
with:
files: build/syncv3_linux_${{ matrix.arch }}
name: ${{ matrix.os }}-${{ matrix.arch }}
path: build/syncv3_${{ matrix.os }}_${{ matrix.arch }}

create-release:
runs-on: ubuntu-latest
steps:
- name: "Fetch all binaries"
uses: actions/download-artifact@v3
- name: "Create release"
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with:
files: build/*
draft: True
fail_on_unmatched_files: true
7 changes: 7 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
0. Ensure that CI passes against the commit you want to release.
1. Tag that release. The tag name should start with `v`. Push it to GitHub.
2. GitHub should see tag and trigger [a GHA workflow](https://github.com/matrix-org/sliding-sync/actions/workflows/release.yml). It should:
- build binaries,
- create a draft release for this tag, and
- uploads the binaries as artifacts to this release.
3. Go to https://github.com/matrix-org/sliding-sync/releases/ to find your release. Check that the binaries are attached successfully. Write release notes. When you're happy, publish.

0 comments on commit a9f4ba4

Please sign in to comment.