@@ -44,29 +44,37 @@ jobs:
44
44
run : go build -o listener
45
45
46
46
release :
47
- name : Create GitHub Release
48
- needs : build
49
- runs-on : ubuntu-latest
50
- if : github.ref == 'refs/heads/main' && github.event_name == 'push'
51
- steps :
52
- - uses : actions/checkout@v3
53
-
54
- - name : Read version
55
- id : version
47
+ - name : Check version
56
48
run : |
57
49
VERSION=$(cat VERSION.txt)
58
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
50
+ echo "version=$VERSION" >> $GITHUB_ENV
51
+ echo "Version: $VERSION"
52
+
53
+ - name : Create Tag
54
+ if : |
55
+ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
56
+ (github.event_name == 'pull_request' &&
57
+ github.event.action == 'closed' &&
58
+ github.event.pull_request.merged == true &&
59
+ github.event.pull_request.base.ref == 'main')
60
+ run : |
61
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
62
+ git config --global user.name "github-actions[bot]"
63
+ git tag "v${{ env.version }}"
64
+ git push origin "v${{ env.version }}"
59
65
60
66
- name : Create GitHub Release
61
- uses : softprops/action-gh-release@v1
67
+ if : |
68
+ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
69
+ (github.event_name == 'pull_request' &&
70
+ github.event.action == 'closed' &&
71
+ github.event.pull_request.merged == true &&
72
+ github.event.pull_request.base.ref == 'main')
73
+ uses : softprops/action-gh-release@v2
62
74
with :
63
- tag_name : v${{ steps.version.outputs.version }}
64
- name : Release v${{ steps.version.outputs.version }}
65
- body : |
66
- Automated release triggered by push to `main`.
67
-
68
- **Version**: v${{ steps.version.outputs.version }}
69
-
70
- _Changes in this release are based on PR history._
75
+ tag_name : v${{ env.version }}
76
+ name : Release v${{ env.version }}
77
+ files : build/monitor.bpf.o
78
+ # generate_release_notes: true
71
79
env :
72
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
80
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments