-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (27 loc) · 882 Bytes
/
Copy pathrelease.yml
File metadata and controls
32 lines (27 loc) · 882 Bytes
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
name: Create Github Release
on:
pull_request:
types:
- closed # Runs when a PR is merged
branches:
- main # Only trigger if merged into main
jobs:
create-release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Read version from gradle.properties
run: |
VERSION=$(grep "^version=" gradle.properties | cut -d'=' -f2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Detected version: $VERSION"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v$VERSION" \
--title "v$VERSION" \
--generate-notes \
--target main