diff --git a/.github/workflows/linting.yaml b/.github/workflows/build.yaml similarity index 65% rename from .github/workflows/linting.yaml rename to .github/workflows/build.yaml index 7870e5e..794c8c4 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/build.yaml @@ -1,9 +1,18 @@ -name: Linting and checks +name: Linting, build, test and release + +# Runs on each PR to lint and test + +# Runs on each release (via github UI) to lint and test, then upload binary to the release on: pull_request: push: branches: [master] + release: + types: [created] + +permissions: + contents: write jobs: changelog: @@ -46,3 +55,14 @@ jobs: run: go build - name: Test run: go test + - name: Create tarball for release + if: github.event.release + run: tar -czf rageshake.tar.gz rageshake + - name: Upload tarball to matching release + if: github.event.release + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 + with: + files: rageshake.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/RELEASING.md b/RELEASING.md index aab181f..7871af3 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,6 +1,6 @@ 1. Set a variable to the version number for convenience: ```sh - ver=x.y + ver=x.y.z ``` 1. Update the changelog: ```sh @@ -15,16 +15,24 @@ 1. Sanity-check the [changelog](https://github.com/matrix-org/rageshake/blob/master/CHANGES.md) and update if need be. -1. Create a signed tag for the release: +1. Create release on GH project page: ```sh - git tag -s v$ver + xdg-open https://github.com/matrix-org/rageshake/releases/new ``` - Base the tag message on the changelog. -1. Push the tag: - ```sh - git push origin tag v$ver + Set the tag to be the new version (eg v2.2.1). + + Ensure you selected "create tag" if it doesn't already exist. + + Release name will be autocompleted to the tag name + + Describe the release based on the changelog + + This will trigger a docker image to be built as well as a binary to be uploaded to the release +1. Check that the docker image has been created and tagged (a few mins) ``` -1. Create release on GH project page: - ```sh - xdg-open https://github.com/matrix-org/rageshake/releases/edit/v$ver + xdg-open https://github.com/matrix-org/rageshake/pkgs/container/rageshake/versions?filters%5Bversion_type%5D=tagged + ``` +1. Check that the rageshake binary has been built and added to the release (a few mins) + ``` + xdg-open https://github.com/matrix-org/rageshake/releases ``` diff --git a/changelog.d/70.misc b/changelog.d/70.misc new file mode 100644 index 0000000..3d494f9 --- /dev/null +++ b/changelog.d/70.misc @@ -0,0 +1 @@ +Update deployment process to automatically build docker containers and binaries.