-
Notifications
You must be signed in to change notification settings - Fork 75
58 lines (52 loc) · 1.85 KB
/
prepare-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
58
name: Prepare Release Version
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Version to release'
required: true
type: string
permissions:
contents: read
jobs:
update_release_version:
name: Initiate Release
if: github.repository == 'spring-projects/spring-pulsar'
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
steps:
- id: checkout-source
name: Checkout source code
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
- name: Set up Gradle
uses: spring-io/spring-gradle-build-action@v2
- id: check-open-issues
name: Check for open issues
run: |
echo "TODO actually check for open issues"
echo "is_open_issues=false" >> $GITHUB_OUTPUT
- id: validate-release-state
name: Validate release state
if: steps.check-open-issues.outputs.is_open_issues == 'true'
run: |
echo "There are open issues"
exit 1
- id: update-version-and-push
name: Update version and push
if: steps.check-open-issues.outputs.is_open_issues == 'false'
env:
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
releaseVersion="${{ inputs.releaseVersion }}"
releaseBranch="release-initiate/$releaseVersion"
git checkout -b $releaseBranch
./gradlew :updateToReleaseVersion -PreleaseVersion=$releaseVersion
git commit -am "[Release $releaseVersion] Update version"
git push origin $releaseBranch
gh pr create --title "[Release $releaseVersion] Update version" --body "Merge to initiate release."