Skip to content

updated workflows for main #28

updated workflows for main

updated workflows for main #28

name: Build and Release Library
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
build-library:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Change wrapper permissions
run: chmod +x micronautpi4j-utils/gradlew
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
build-root-directory: micronautpi4j-utils/
- name: Execute Gradle build
working-directory: micronautpi4j-utils
run: ./gradlew shadowJar
publish-jar:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: build-library
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'gradle'
- name: Change wrapper permissions
run: chmod +x micronautpi4j-utils/gradlew
- name: Publish Library
working-directory: micronautpi4j-utils
env:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon