5
5
#
6
6
# GitHub Actions reference: https://help.github.com/en/actions
7
7
#
8
- on :
9
- push :
10
- branches :
11
- - main
8
+ on :
9
+ push :
10
+ branches :
11
+ - main
12
12
13
- jobs :
14
- main :
15
- runs-on : ubuntu-latest
16
- steps :
17
- # Check out current repository
18
- - name : Fetch Sources
19
- uses : actions/checkout@v3
13
+ jobs :
14
+ publish_snapshot :
15
+ name : Publish Snapshot
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ # Check out current repository
19
+ - name : Fetch Sources
20
+ uses : actions/checkout@v3
20
21
21
- # Set up Java environment for the next steps
22
- - name : Setup Java
23
- uses : actions/setup-java@v3
24
- with :
25
- distribution : zulu
26
- java-version : 17
22
+ # Set up Java environment for the next steps
23
+ - name : Setup Java
24
+ uses : actions/setup-java@v3
25
+ with :
26
+ distribution : zulu
27
+ java-version : 17
28
+ - name : Publish Snapshot
29
+ run : |
30
+ chmod +x ./publish_snapshot.sh
31
+ ./publish_snapshot.sh ${{secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME}} ${{secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD}}
27
32
28
- # Set environment variables
29
- - name : Export Properties
30
- id : properties
31
- shell : bash
32
- run : |
33
- PROPERTIES="$(./gradlew properties --console=plain -q)"
34
- VERSION="$(echo "$PROPERTIES" | grep "^VERSION_NAME:" | cut -f2- -d ' ')"
35
- CHANGELOG="$(./get_changelog.sh)"
36
- echo "version=$VERSION" >> $GITHUB_OUTPUT
37
- echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
38
-
39
- # Remove old release drafts by using the curl request for the available releases with a draft flag
40
- - name : Remove Old Release Drafts
41
- env :
42
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43
- run : |
44
- gh api repos/{owner}/{repo}/releases \
45
- --jq '.[] | select(.draft == true) | .id' \
46
- | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
33
+ update_draft_release :
34
+ name : Create or Update Draft Release
35
+ runs-on : ubuntu-latest
36
+ steps :
37
+ # Check out current repository
38
+ - name : Fetch Sources
39
+ uses : actions/checkout@v3
47
40
48
- # Create a new release draft which is not publicly visible and requires manual acceptance
49
- - name : Create Release Draft
50
- env :
51
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52
- run : |
53
- gh release create v${{ steps.properties.outputs.version }} \
54
- --draft \
55
- --title "v${{ steps.properties.outputs.version }}" \
56
- --notes "${{ steps.properties.outputs.changelog }}" \
41
+ # Set up Java environment for the next steps
42
+ - name : Setup Java
43
+ uses : actions/setup-java@v3
44
+ with :
45
+ distribution : zulu
46
+ java-version : 17
47
+
48
+ # Set environment variables
49
+ - name : Export Properties
50
+ id : properties
51
+ shell : bash
52
+ run : |
53
+ PROPERTIES="$(./gradlew properties --console=plain -q)"
54
+ VERSION="$(echo "$PROPERTIES" | grep "^VERSION_NAME:" | cut -f2- -d ' ')"
55
+ chmod +x ./get_changelog.sh
56
+ CHANGELOG="$(./get_changelog.sh $VERSION)"
57
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
58
+ echo "changelog=$(echo "$CHANGELOG" | base64 )" >> $GITHUB_OUTPUT
59
+
60
+ # Remove old release drafts by using the curl request for the available releases with a draft flag
61
+ - name : Remove Old Release Drafts
62
+ env :
63
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64
+ run : |
65
+ gh api repos/{owner}/{repo}/releases \
66
+ --jq '.[] | select(.draft == true) | .id' \
67
+ | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
68
+
69
+ # Create a new release draft which is not publicly visible and requires manual acceptance
70
+ - name : Create Release Draft
71
+ env :
72
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73
+ run : |
74
+ gh release create v${{ steps.properties.outputs.version }} \
75
+ --draft \
76
+ --title "v${{ steps.properties.outputs.version }}" \
77
+ --notes "$(echo "${{ steps.properties.outputs.changelog }}" | base64 --decode)"
0 commit comments