-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (53 loc) · 1.47 KB
/
release.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
51
52
53
54
55
56
57
name: Release
on:
push:
branches:
- main
paths:
- "**.go"
- "**/go.mod"
- "**/go.sum"
workflow_dispatch: {}
permissions: read-all
jobs:
releaser:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
WITH_V: true
DRY_RUN: true
- run: |
tee version.go << END
package aiven
// Version returns aiven-go-client version string
func Version() string {
return "${{ steps.version.outputs.new_tag }}"
}
END
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "chore(version.go): update go-client-codegen version"
git push
- id: sha
run: |
GIT_SHA=$(git rev-parse HEAD)
echo "sha=${GIT_SHA::7}" >> $GITHUB_OUTPUT
- id: tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
WITH_V: true
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.new_tag }}
name: ${{ steps.version.outputs.new_tag }}
body: auto-generated release for commit ${{ steps.sha.outputs.sha }}