-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 1.29 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
on:
pull_request:
branches: ["*"]
tags-ignore:
- "release-please--*" # Exclude tags containing "staging"
name: test build
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- uses: actions/setup-go@v5
if: ${{ steps.release.outputs.release_created }}
with:
go-version: "^1.23.3"
- name: Build project and prepare release artifact
if: ${{ steps.release.outputs.release_created }}
run: |
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X cpenv/cmd.Version=${{ steps.release.outputs.tag_name }}" -o ./compile/cpenv-darwin-arm64 ./main.go
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X cpenv/cmd.Version=${{ steps.release.outputs.tag_name }}" -o ./compile/cpenv-darwin-amd64 ./main.go
env GOOS=darwin GOARCH=386 go build -ldflags "-X cpenv/cmd.Version=${{ steps.release.outputs.tag_name }}" -o ./compile/cpenv-darwin-386 ./main.go