Skip to content

Merge pull request #23 from mbevc1/dependabot/go_modules/golang.org/x… #88

Merge pull request #23 from mbevc1/dependabot/go_modules/golang.org/x…

Merge pull request #23 from mbevc1/dependabot/go_modules/golang.org/x… #88

Workflow file for this run

#on: pull_request
on:
push:
branches:
- '**'
tags:
- 'v*'
#tag-ignore:
# - 'v*'
workflow_dispatch: {}
name: ReAcT
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
#go-version: 'stable'
go-version-file: 'go.mod'
check-latest: true
id: go
- name: Lint
run: |
go mod tidy
make fmt
make vet
#go get -u golang.org/x/lint/golint
#make lint
if: success()
- name: Test
run: make test
if: success()
- name: Build
run: go build -mod vendor ./...
if: success()
release:
if: startsWith(github.ref, 'refs/tags/v')
name: Release
runs-on: ubuntu-latest
needs: [ test ]
steps:
# - name: Check out code
# uses: actions/checkout@master
# - name: goreleaser
# uses: docker://goreleaser/goreleaser
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# args: release
# if: success()
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # disable shallow clone - get all
#- name: Unshallow
# run: git fetch --prune --unshallow
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
id: go
- name: Generate build tag
run: |
VERSION=$(git describe --tags --always --dirty --match=v* 2> /dev/null || echo v0)
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: /bin/bash -e {0}
- name: Print build tag
run: echo "${VERSION}"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2' # latest
args: release --clean
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}