Skip to content

version up 1.0.2

version up 1.0.2 #3

#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