diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 50c1e53..47f7e49 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,32 +1,44 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go +name: Build and Publish Golang App on: push: - branches: [ "main" ] + branches: [ main ] pull_request: - branches: [ "main" ] + branches: [ main ] jobs: - build: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - uses: priya-kinthali/setup-go@poc-build - - - name: Set up Go - uses: actions/setup-go@v4 - - with: - go-version: '1.20' - - - name: Build - run: go build -v ./... - - - name: Test - run: go test -v ./... - - + - uses: actions/checkout@v3 + + - name: Set up Go + uses: priya-kinthali/setup-go@poc-build + with: + go-version: '1.20' + + - name: Build the application + run: go build -v ./... + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: golang-app + path: ./ + + publish: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: golang-app + path: ./ + + - name: Publish + uses: goreleaser/goreleaser-action@v2 + with: + args: release --rm-dist