diff --git a/.github/workflows/build_on_release.yml b/.github/workflows/build_on_release.yml index aa52d3f6..69a078d5 100644 --- a/.github/workflows/build_on_release.yml +++ b/.github/workflows/build_on_release.yml @@ -4,10 +4,7 @@ on: types: [created] 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 +12,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