removed build #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI for Actio Go Build | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| tags: [ 'v*.*.*' ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.22' | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download dependencies | |
| working-directory: ./actio | |
| run: go mod download | |
| - name: Run tests | |
| working-directory: ./actio | |
| run: go test -v ./... | |
| - name: Run go vet | |
| working-directory: ./actio | |
| run: go vet ./... | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.22' | |
| - name: Build | |
| working-directory: ./actio | |
| run: go build -v ./... | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [test, build] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.22' | |
| - name: Run GoReleaser | |
| run: | | |
| mkdir -p /tmp/goreleaser | |
| curl -L https://github.com/goreleaser/goreleaser/releases/download/v1.26.2/goreleaser_Linux_x86_64.tar.gz -o /tmp/goreleaser.tar.gz | |
| tar -xzf /tmp/goreleaser.tar.gz -C /tmp/goreleaser | |
| export PATH="/tmp/goreleaser:$PATH" | |
| cd actio | |
| goreleaser release --clean --config ../.goreleaser.yml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |