From 9475d3dbd791c1da0a858522dfda420e8e279bf2 Mon Sep 17 00:00:00 2001 From: Jille Timmermans Date: Tue, 16 Apr 2024 14:25:21 +0200 Subject: [PATCH] CI: Automatically publish releases with an attached binary --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..651cea2983 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + tags: + - 'v*-hx*' + +jobs: + + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + + - run: mkdir _publish + + - name: Build for linux/amd64 + run: go build -v -ldflags "-X github.com/sqlc-dev/sqlc/internal/cmd.version=${{github.ref_name}}" -o _publish/sqlc ./cmd/sqlc/ + env: + CGO_ENABLED: 0 + GOARCH: amd64 + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: _publish/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}