diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1ef4be1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: release +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 0 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..0d7480a --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,15 @@ +builds: + - skip: true + +release: + prerelease: auto + +changelog: + use: github + filters: + exclude: + - "^build\\(deps\\)" + - "^Bump" + - "^.github" + - "^.goreleaser" + - "^scripts" diff --git a/README.md b/README.md index 7140304..884c02f 100644 --- a/README.md +++ b/README.md @@ -53,3 +53,10 @@ func main() { devices, err := client.Devices().List(context.Background()) } ``` + +## Releasing + +Pushing a tag of the format `vX.Y.Z` will trigger the [release workflow](./.github/workflows/release.yml) which uses +[goreleaser](https://github.com/goreleaser/goreleaser) to build and sign artifacts and generate a +[GitHub release](https://github.com/tailscale/tailscale-client-go-v2/releases). +