From 1c37111511271ec1be95a3a5b778ccc77299328a Mon Sep 17 00:00:00 2001 From: Yukun Wang Date: Wed, 10 Apr 2024 17:52:13 +0800 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57e051c..a05182d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: - v* jobs: release: + strategy: + matrix: + os: ["linux","windows","darwin"] + arch: ["amd64","arm64"] name: Release runs-on: ubuntu-latest steps: @@ -12,27 +16,16 @@ jobs: - uses: actions/setup-go@v3 with: go-version: 1.22.x + - run: ./test.sh - run: go mod download - run: go test -v ./... - - run: go build -v . - - run: ./test.sh + - run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o release/crd-ref-docs-${{ matrix.os }}-${{ matrix.arch }} -v . - - name: Create release - uses: actions/create-release@v1 - id: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - - name: Upload artifacts - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 with: - upload_url: ${{ steps.release.outputs.upload_url }} - asset_path: ./crd-ref-docs - asset_name: crd-ref-docs - asset_content_type: application/octet-stream + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: release/crd-ref-docs-${{ matrix.os }}-${{ matrix.arch }} + asset_name: crd-ref-docs-${{ matrix.os }}-${{ matrix.arch }} + tag: ${{ github.ref }}