From 4e8eff26271993dec3f39529864c5763a3a17619 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Wed, 28 Feb 2024 10:24:59 +0100 Subject: [PATCH] build binaries Signed-off-by: Nicolas De Loof --- .github/workflows/release.yml | 60 +++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f50be59d..f2c3abe3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,26 +1,60 @@ name: Release on: + push: + tags: + - 'v*' workflow_dispatch: - inputs: - branch: - description: "Branch" - required: true - default: "main" - tag: - description: "Release Tag" - - jobs: + binary: + runs-on: ubuntu-latest + strategy: + matrix: + os: [linux, darwin, windows] + arch: [amd64, arm64] + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '2.21' + - run: go version + - + name: Build + run: | + GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} make build + - + name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: compose-spec + path: ./bin/* + if-no-files-found: error + release: - runs-on: ubuntu-latest + permissions: + contents: write # to create a release (ncipollo/release-action) + runs-on: ubuntu-latest + needs: + - binary steps: - - name: Release it! - if: ${{ github.event.inputs.tag != '' }} # don't release if no tag is specified + - + name: Checkout + uses: actions/checkout@v3 + - + name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: compose + path: bin/release + - + name: GitHub Release uses: ncipollo/release-action@v1 with: generateReleaseNotes: true draft: true token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ github.event.inputs.tag }} commit: ${{ github.event.inputs.branch }}