Skip to content

Commit

Permalink
workflow issues
Browse files Browse the repository at this point in the history
  • Loading branch information
henrriusdev committed Feb 23, 2025
1 parent 82f92bd commit dec306e
Showing 1 changed file with 16 additions and 61 deletions.
77 changes: 16 additions & 61 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,80 +9,35 @@ 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:
build:
name: Build CLI for Multiple Platforms
runs-on: ubuntu-latest

strategy:
matrix:
os: [linux, darwin]
arch: [amd64, arm64]
goos: [windows, linux, darwin]
goarch: [amd64, arm64]

steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.24"

- name: Build Linux/macOS Executable
- name: Build 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-*
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/tfenv-${{ matrix.goos }}-${{ matrix.goarch }}
release:
needs: [build-windows, build-linux-macos]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Remove Existing Artifact (if any)
continue-on-error: true
run: rm -rf build/tfenv-${{ matrix.goos }}-${{ matrix.goarch }}

- 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
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
tag_name: ${{ github.ref_name }}
name: "Release ${{ github.ref_name }}"
draft: false
prerelease: false
files: build/tfenv-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: tfenv-${{ matrix.goos }}-${{ matrix.goarch }}
path: build/tfenv-${{ matrix.goos }}-${{ matrix.goarch }}

0 comments on commit dec306e

Please sign in to comment.