From 697ac7a0626989313e6920fd7a1603af25c2e79f Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 11 Oct 2023 15:11:39 +0100 Subject: [PATCH 1/2] WIP: create a release in response to the tag --- .github/workflows/release.yml | 25 +++++++++++++++++++------ RELEASING.md | 0 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 RELEASING.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f024842..c51f4c76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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 \ No newline at end of file diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 00000000..e69de29b From 3b14c056c85f6bb2b5c437a0bf725eb363d5cf20 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 11 Oct 2023 15:13:29 +0100 Subject: [PATCH 2/2] Terse notes on how to release --- RELEASING.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/RELEASING.md b/RELEASING.md index e69de29b..77320c28 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -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. \ No newline at end of file