forked from androidPluto/pluto
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (93 loc) · 3.6 KB
/
process_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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#name: Release Workflow
on:
push
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
- name: Publish package
run: ./gradlew publishReleasePublicationToGitHubPackagesRepository
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
#jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
#
# - name: Run on New Release
# run: |
# echo "A new release was created."
# echo "Release name: ${{ github.event.release.name }}"
# echo "Release tag: ${{ github.event.release.tag_name }}"
#
# - name: Validating Release
# run: |
# pattern="^v[0-9]+(\.[0-9]+)+$"
# if [[ ${{ github.event.release.name }} =~ $pattern ]]; then
# echo "${{ github.event.release.name }} is valid"
# else
# echo "${{ github.event.release.name }} is not valid"
# exit 1
# fi
#
# - name: Extract Version details
# run: |
# releaseName="${{ github.event.release.name }}"
# echo "release name: $releaseName"
# versionName=${releaseName:1}
# echo "version name: $versionName"
# IFS='.' read -ra versionStubs <<< "$versionName"
# echo "versionMajor : ${versionStubs[0]}"
# echo "versionMinor : ${versionStubs[1]}"
# echo "versionPatch : ${versionStubs[2]}"
#
# echo "versionMajor=${versionStubs[0]}" >> $GITHUB_ENV
# echo "versionMinor=${versionStubs[1]}" >> $GITHUB_ENV
# echo "versionPatch=${versionStubs[2]}" >> $GITHUB_ENV
#
# - name: Commit version.properties changes
# run: |
# git fetch --all
# git checkout develop
# echo "major=${{ env.versionMajor }}" > version.properties
# echo "minor=${{ env.versionMinor }}" >> version.properties
# echo "patch=${{ env.versionPatch }}" >> version.properties
# echo "channel=release" >> version.properties
# echo "build=0" >> version.properties
#
# git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# git config --local user.name "${GITHUB_ACTOR}"
# git add version.properties
#
# commitTitle="ci(release): version bump ${{ env.versionMajor }}.${{ env.versionMinor }}.${{ env.versionPatch }}"
# commitBody="see release details https://github.com/androidPluto/pluto/releases/tag/${{ github.event.release.tag_name }}"
# git commit -m "$commitTitle" -m "$commitBody"
#
## - name: Publish artifacts to MavenCentral
### run: ./gradlew publish
## run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
## env:
## OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
## OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
## SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
## SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
## SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
## SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
##
# - name: Pushing changes to version.properties post deployment
# run: |
# git fetch --all
# git checkout develop
# git push