From 1c2ffb8d7abef2e0680e43525b793bacc3a242a0 Mon Sep 17 00:00:00 2001 From: Artem Torubarov Date: Tue, 30 Apr 2024 15:42:40 +0200 Subject: [PATCH] release action --- .github/workflows/ci-go.yml | 55 ++++++----------------------------- .github/workflows/release.yml | 8 +++-- .goreleaser.yml | 5 ++-- 3 files changed, 16 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml index 1eea71c..ee1fed9 100644 --- a/.github/workflows/ci-go.yml +++ b/.github/workflows/ci-go.yml @@ -10,52 +10,15 @@ jobs: test: runs-on: ubuntu-latest steps: - # - uses: actions/checkout@v4 - # - name: Set up Go - # uses: actions/setup-go@v3 - # with: - # go-version: "1.21" - uses: actions/checkout@v4 - - uses: actions/setup-go@v3 + - name: Set up Go + uses: actions/setup-go@v3 with: go-version: "1.21" - - name: Install zip - uses: montudor/action-zip@v1 - - name: Build standalone binaries - run: | - mkdir standalone - platforms=("darwin/amd64" "darwin/arm64" "linux/386" "linux/amd64" "linux/arm64" "windows/amd64" "windows/386" ) - for platform in "${platforms[@]}" - do - platform_split=(${platform//\// }) - GOOS=${platform_split[0]} - GOARCH=${platform_split[1]} - bin_name='chorus' - output_name='standalone_''v0.1.0''_'$GOOS'_'$GOARCH - # output_name='standalone_'${{ github.ref_name }}'_'$GOOS'_'$GOARCH - if [ $GOOS = "windows" ]; then - bin_name+='.exe' - output_name+='.zip' - else - output_name+='.tar.gz' - fi - env GOOS=$GOOS GOARCH=$GOARCH go build -o $bin_name ./cmd/chorus - if [ $? -ne 0 ]; then - echo 'An error has occurred! Aborting the script execution...' - exit 1 - fi - if [ $GOOS = "windows" ]; then - zip -r standalone/$output_name ./$bin_name - else - tar -cvzf standalone/$output_name ./$bin_name - fi - rm ./$bin_name - done - - # - # - name: Fmt - # run: go fmt ./... - # - name: Vet - # run: go vet ./... - # - name: Test - # run: go test ./... + + - name: Fmt + run: go fmt ./... + - name: Vet + run: go vet ./... + - name: Test + run: go test ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d751c7..30dd75b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,10 +100,12 @@ jobs: done - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v5 with: - version: latest - args: release --rm-dist + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: v5.0.0 + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BREW_RELEASE_TOKEN: ${{ secrets.BREW_RELEASE_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index df4d951..88e0c74 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -31,10 +31,10 @@ checksum: name_template: checksums.txt brews: - name: chorctl - app: chorctl - tap: + repository: owner: clyso name: homebrew-tap + token: '{{ .Env.BREW_RELEASE_TOKEN }}' commit_author: name: clyso_bot email: release-bot@clyso.com @@ -47,7 +47,6 @@ brews: system "#{bin}/chorctl --version" install: | bin.install "chorctl" - token: '{{ .Env.BREW_RELEASE_TOKEN }}' release: github: owner: clyso