fix not generating builds #11
Workflow file for this run
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 Release tfenv | |
on: | |
push: | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
arch: [amd64, arm64] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.24" | |
- name: Build Windows Executable | |
run: | | |
mkdir -p build | |
go build -o build/tfenv-windows-${{ matrix.arch }}.exe | |
- name: Upload Windows Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-build | |
path: build/tfenv-windows-*.exe | |
build-linux-macos: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [linux, darwin] | |
arch: [amd64, arm64] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.24" | |
- name: Build Linux/macOS Executable | |
run: | | |
mkdir -p build | |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o build/tfenv-${{ matrix.os }}-${{ matrix.arch }} | |
- name: Upload Linux/macOS Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-macos-build | |
path: build/tfenv-* | |
release: | |
needs: [build-windows, build-linux-macos] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Download All Built Binaries | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: build/ | |
- name: List downloaded files | |
run: ls -lh build/ | |
- name: Upload Release Assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref_name }} | |
name: "Release ${{ github.ref_name }}" | |
draft: false | |
prerelease: false | |
files: build/tfenv-* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |