Skip to content

fix missing .exe for windows in release #15

fix missing .exe for windows in release

fix missing .exe for windows in release #15

Workflow file for this run

name: Build and Release tfenv
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build CLI for Multiple Platforms
runs-on: ubuntu-latest
strategy:
matrix:
goos: [windows, linux, darwin]
goarch: [amd64, arm64]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.24"
- name: Build Executable
run: |
mkdir -p build
EXT=""
if [ "${{ matrix.goos }}" == "windows" ]; then EXT=".exe"; fi
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/tfenv-${{ matrix.goos }}-${{ matrix.goarch }}$EXT
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: tfenv-${{ matrix.goos }}-${{ matrix.goarch }}
path: build/tfenv-${{ matrix.goos }}-${{ matrix.goarch }}*
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: build # Wait for build job
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: "Release ${{ github.ref_name }}"
draft: false
prerelease: false
files: release-assets/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}