Skip to content

chore: bump version to v1.0.0 #6

chore: bump version to v1.0.0

chore: bump version to v1.0.0 #6

Workflow file for this run

name: Go CI/CD
on:
push:
branches: [ "master" ]
tags: [ "v*" ]
pull_request:
branches: [ "master" ]
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.7'
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test -v ./...
- name: Run vet
run: go vet ./...
- name: Check formatting
run: |
if [ -n "$(go fmt ./...)" ]; then
echo "Code is not formatted. Please run 'go fmt ./...'"
exit 1
fi
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.7'
- name: Build
run: make build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tictactoe
path: build/tictactoe
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.7'
- name: Build for multiple platforms
run: |
GOOS=linux GOARCH=amd64 go build -o build/tictactoe-linux-amd64
GOOS=darwin GOARCH=amd64 go build -o build/tictactoe-darwin-amd64
GOOS=windows GOARCH=amd64 go build -o build/tictactoe-windows-amd64.exe
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
build/tictactoe-linux-amd64
build/tictactoe-darwin-amd64
build/tictactoe-windows-amd64.exe
body_path: CHANGELOG.md
generate_release_notes: false