Update dependencies #111
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: Main | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
branches: | |
- 'main' | |
permissions: | |
contents: write | |
env: | |
GO_VERSION: '1.21.5' | |
jobs: | |
test_publish: | |
name: Test and publish | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Needed to describe git ref during build. | |
- name: Install libvirt | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libvirt-dev | |
- name: Export GOBIN | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '${{env.GO_VERSION}}' | |
- name: Install dependencies | |
run: make setup | |
- name: Run tests | |
run: make test | |
- name: Build | |
run: make build | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
if: startsWith(github.ref, 'refs/tags/v') # Only release for tagged commits. | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |