From 40a2ea99b1f5c1128e8425470d4623e33b20a1e9 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 2 Nov 2021 18:04:16 +0300 Subject: [PATCH 1/2] Add goreleaser to IZE build --- .github/workflows/build_on_release.yml | 24 +++++++++++------------- .goreleaser.yml | 13 +++++++++++++ 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 .goreleaser.yml diff --git a/.github/workflows/build_on_release.yml b/.github/workflows/build_on_release.yml index aa52d3f6..a253675c 100644 --- a/.github/workflows/build_on_release.yml +++ b/.github/workflows/build_on_release.yml @@ -2,12 +2,10 @@ name: "Build IZE on release" on: release: types: [created] + workflow_dispatch: jobs: Build: - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Install Go uses: actions/setup-go@v2 @@ -15,14 +13,14 @@ jobs: go-version: 1.16.x - name: Checkout code uses: actions/checkout@v2 - - name: Build - run: go build -o ./ize ./cmd - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 + with: + fetch-depth: 0 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: release -f .goreleaser.yml --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ./ize - asset_name: ${{ runner.os }} - asset_content_type: application/zip diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..6689270f --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,13 @@ +project_name: ize +builds: + - env: [CGO_ENABLED=0] + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + id: "ize" + dir: . + main: ./cmd From a0a304b3527f4d6da5628b63df784dd962a3df4d Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 2 Nov 2021 18:04:38 +0300 Subject: [PATCH 2/2] Add goreleaser to IZE build2 --- .github/workflows/build_on_release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_on_release.yml b/.github/workflows/build_on_release.yml index a253675c..69a078d5 100644 --- a/.github/workflows/build_on_release.yml +++ b/.github/workflows/build_on_release.yml @@ -2,7 +2,6 @@ name: "Build IZE on release" on: release: types: [created] - workflow_dispatch: jobs: Build: runs-on: ubuntu-latest