-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.85 KB
/
release-please.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: go
- 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=arm64 go build -ldflags "-X github.com/y3owk1n/cpenv/cmd.Version=${{ steps.release.outputs.tag_name }}" -o ./compile/cpenv-darwin-arm64 ./main.go
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/y3owk1n/cpenv/cmd.Version=${{ steps.release.outputs.tag_name }}" -o ./compile/cpenv-darwin-amd64 ./main.go
- name: Upload Release Artifact
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
run: |
gh release upload ${{ steps.release.outputs.tag_name }} ./compile/cpenv-darwin-arm64
gh release upload ${{ steps.release.outputs.tag_name }} ./compile/cpenv-darwin-amd64