Skip to content

[ RELEASE ] Package & Deploy #14

[ RELEASE ] Package & Deploy

[ RELEASE ] Package & Deploy #14

#
name: '[ RELEASE ] Package & Deploy'
on:
workflow_dispatch:
inputs:
BUILD_VERSION:
description: 'The version to build and deploy'
required: true
default: '0-SNAPSHOT'
release:
types: [created]
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
BUILD_VERSION: ${{ steps.release_version.outputs.BUILD_VERSION }}
steps:
- name: "Release Version"
id: release_version
run: |
VERSION=${RELEASE_TAG#v}
echo "BUILD_VERSION=${RELEASE_TAG#v}" >> "$GITHUB_ENV"
echo "BUILD_VERSION=${RELEASE_TAG#v}" >> "$GITHUB_OUTPUT"
echo "Release version is $VERSION"
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3 # v3.1.0
- name: Build with Gradle Wrapper
with:
BUILD_VERSION: ${{ steps.release_version.outputs.BUILD_VERSION }}
run: ./gradlew -P${{ BUILD_VERSION }} build jacocoTestReport

Check failure on line 52 in .github/workflows/publish-githubpkg.yml

View workflow run for this annotation

GitHub Actions / [ RELEASE ] Package & Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/publish-githubpkg.yml (Line: 52, Col: 9): Unexpected value 'run' .github/workflows/publish-githubpkg.yml (Line: 49, Col: 9): Required property is missing: uses
- name: Sign artifacts
run: ./gradlew signMavenJavaPublication
env:
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to GitHub Packages
run: ./gradlew publish
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: publish to sonar central
run: ./gradlew sonatypeCentralUpload
env:
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
SONATYPE_CENTRAL_USERNAME: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
SONATYPE_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}