Skip to content

Refactor CI workflow: Update Go version to 1.20 and enclose in quotes #9

Refactor CI workflow: Update Go version to 1.20 and enclose in quotes

Refactor CI workflow: Update Go version to 1.20 and enclose in quotes #9

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "v*.*.*" # Triggers release on tags like v1.0.0
pull_request:
workflow_dispatch:
permissions:
contents: write # Required for creating releases
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20" # Enclosed in quotes to prevent misinterpretation
- name: Run Tests
run: go test -v ./...
release:
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20" # Enclosed in quotes to prevent misinterpretation
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}