Bump actions/checkout from 3 to 4 #26
Workflow file for this run
This file contains 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: Continuous Integration | |
on: | |
pull_request: | |
push: | |
jobs: | |
build: | |
name: Test | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20.1' | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Get dependencies | |
run: | | |
go mod download | |
- name: Test Build | |
run: | | |
export LDFLAGS="-X main.version=TEST${GITHUB_REF_NAME}TEST -X main.revision=TEST${GITHUB_SHA}TEST -X main.built=`date -u +%Y-%m-%dT%H:%M:%SZ`" | |
go build -ldflags "$LDFLAGS" -o dist/watch-linux-amd64 . | |
dist/watch-linux-amd64 --version | grep " Version: TEST${GITHUB_REF_NAME}TEST" | |
dist/watch-linux-amd64 --version | grep " Revision: TEST${GITHUB_SHA}TEST" | |
- name: Tests | |
run: | | |
go test -v ./... | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |