-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (36 loc) · 1.21 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
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: go
- run: echo "release_created=${{ steps.release.outputs.release_created }}" >> "$GITHUB_OUTPUT"
- run: echo "tag_name=${{ steps.release.outputs.tag_name }}" >> "$GITHUB_OUTPUT"
set-version-and-upload:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- run: |
go build -o ptah-agent-linux-x86_64.bin \
-ldflags "-X main.version=${{ needs.release-please.outputs.tag_name }}" \
cmd/ptah-agent/ptah-agent.go
- run: gh release upload "${{ needs.release-please.outputs.tag_name }}" ptah-agent-linux-x86_64.bin
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}