Added dependabot, update github actions, update go to 1.23 (#34) #14
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: Build and Publish Go Binary | |
on: | |
push: | |
branches: | |
- 'release/*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [linux, darwin, windows] | |
arch: [amd64, arm64] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
- name: Build Go binaries | |
run: | | |
if [ ${{ matrix.os }} == "windows" ]; then | |
CGO_ENABLED=0 GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o tf-profile.exe . | |
else | |
CGO_ENABLED=0 GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o tf-profile . | |
fi | |
- name: Extract release version from branch name | |
id: release_version | |
run: echo "::set-output name=version::${GITHUB_REF##*/}" | |
- name: Create artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tf-profile-v${{ steps.release_version.outputs.version }}-${{ matrix.os }}-${{ matrix.arch }} | |
path: | | |
./tf-profile | |
./tf-profile.exe |