Skip to content

Verify and Publish 0.1.3 #7

Verify and Publish 0.1.3

Verify and Publish 0.1.3 #7

Workflow file for this run

name: Release
run-name: Verify and Publish ${{ github.ref_name }}
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
name: Verify and Publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
cache-read-only: false
- name: Run detekt
if: false # Disable while testing
run: ./gradlew detekt
- name: Run tests with coverage verification
if: false # Disable while testing
run: ./gradlew koverVerify
- name: Configure Git Credentials
run: |
git config user.name "Messias Junior"
git config user.email "messiaslima@users.noreply.github.com"
- name: Update version in build files
run: |
git fetch
git checkout main
sed -i -E 's/version = "[0-9]+\.[0-9]+\.[0-9]+"/version = "${{ github.ref_name }}"/g' build.gradle.kts
- name: Publish to Maven Central
if: false # Disable while testing
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
- name: Commit and push changes
run: |
git add .
git commit --no-verify -m "chore: Release version ${{ github.ref_name }}"
git push