ci: fix indentation in release workflow script #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: Go CI | |
on: | |
# Trigger the workflow on a push with a tag starting with 'v' | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
go-version: ["1.22.x"] | |
arch: [amd64] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Go environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install dependencies | |
run: go get -v -t -d ./... | |
- name: Build binary | |
run: | | |
mkdir -p build/${{ matrix.os }}-${{ matrix.arch }} | |
GOOS=$(if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then echo "linux"; else echo "windows"; fi) GOARCH=${{ matrix.arch }} go build -v \ | |
-o build/${{ matrix.os }}-${{ matrix.arch }}/app \ | |
./cmd/flower | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.os }}-${{ matrix.arch }} | |
path: build/${{ matrix.os }}-${{ matrix.arch }}/app | |
release: | |
name: Release | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-ubuntu-latest-amd64 | |
path: build/linux-amd64 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-windows-latest-amd64 | |
path: build/windows-amd64 | |
- name: Upload Binaries | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
run: | | |
gh release create -p "$tag" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \ | |
$(find . -type f -name "flower*amd64*" -printf "%p ") |