Skip to content

Commit

Permalink
ci(workflow): update OS matrix and improve build artifact handling in…
Browse files Browse the repository at this point in the history
… release workflow
  • Loading branch information
AlbinoGeek committed Jun 22, 2024
1 parent 794e088 commit d37a8e9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [linux, windows]
go-version: ["1.22.x"]
arch: [amd64]
package: [flower, flower-tui]
Expand All @@ -34,9 +34,13 @@ jobs:

- name: Build ${{ matrix.package }} for ${{ matrix.os }} (${{ matrix.arch }})
run: |
outfile=${{ matrix.package }}-${{ matrix.os }}-${{ matrix.arch }}
if [ "${{ matrix.os }}" = "windows" ]; then
outfile="${outfile}.exe"
fi
mkdir -p build/
GOOS=$(if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then echo "linux"; else echo "windows"; fi) GOARCH=${{ matrix.arch }} go build -v \
-o build/${{ matrix.package }} \
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -v \
-o "build/$outfile" \
./cmd/${{ matrix.package }}
- name: Archive build artifact
Expand All @@ -45,7 +49,7 @@ jobs:
compression-level: 0
if-no-files-found: error
name: ${{ matrix.package }}-${{ matrix.os }}-${{ matrix.arch }}
path: build/${{ matrix.package }}
path: build/${{ matrix.package }}-${{ matrix.os }}-${{ matrix.arch }}*

release:
name: Release
Expand Down Expand Up @@ -73,8 +77,4 @@ jobs:
echo "Tag name is $tagname"
ls -lR build/*
echo "Uploading release assets..."
files=$(for f in build/*; do
echo -n " $f"
done)
echo "Files are $files"
GH_DEBUG=api gh release create "$tagname" -t "$tagname" $files
GH_DEBUG=api gh release create "$tagname" -t "$tagname" build/*

0 comments on commit d37a8e9

Please sign in to comment.