Skip to content

Commit

Permalink
fix(ci): perform checkout before setup-go
Browse files Browse the repository at this point in the history
  • Loading branch information
mlcdf committed Nov 23, 2022
1 parent 0cf0fb4 commit 9ab047a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ jobs:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.19"
check-latest: true
cache: true

- name: Checkout repository
uses: actions/checkout@v3

- name: Build binaries
run: |
export VERSION=$(git describe --tags)
export CGO_ENABLED=0
export LDFLAGS="-X 'main.Version=${VERSION}'"
GOOS=linux GOARCH=amd64; go build -v -o "owh-${VERSION}-${GOOS}-${GOARCH}" -ldflags "${LDFLAGS}"
GOOS=linux GOARCH=arm; GOARM=6 go build -o "owh-${VERSION}-${GOOS}-${GOARCH}" -ldflags "${LDFLAGS}"
GOOS=linux GOARCH=arm64; go build -o "owh-${VERSION}-${GOOS}-${GOARCH}" -ldflags "${LDFLAGS}"
GOOS=darwin GOARCH=amd64; go build -o "owh-${VERSION}-${GOOS}-${GOARCH}" -ldflags "${LDFLAGS}"
GOOS=windows GOARCH=amd64; go build -o "owh-${VERSION}-${GOOS}-${GOARCH}.exe" -ldflags "${LDFLAGS}"
export GOOS=linux GOARCH=amd64 && go build -v -o "owh-${VERSION}-${GOOS}-${GOARCH}" -ldflags "${LDFLAGS}"
export GOOS=linux GOARCH=arm GOARM=6 && go build -o "owh-${VERSION}-${GOOS}-${GOARCH}" -ldflags "${LDFLAGS}"
export GOOS=linux GOARCH=arm64 && go build -o "owh-${VERSION}-${GOOS}-${GOARCH}" -ldflags "${LDFLAGS}"
export GOOS=darwin GOARCH=amd64 && go build -o "owh-${VERSION}-${GOOS}-${GOARCH}" -ldflags "${LDFLAGS}"
export GOOS=windows GOARCH=amd64 && go build -o "owh-${VERSION}-${GOOS}-${GOARCH}.exe" -ldflags "${LDFLAGS}"
- name: Upload release artifacts
uses: actions/github-script@v5
Expand Down

0 comments on commit 9ab047a

Please sign in to comment.