API Improvments #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
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: | |
ReleaseVersion: | |
runs-on: ubuntu-latest | |
outputs: | |
build_version: ${{ steps.release_version.outputs.build_version }} | |
steps: | |
- name: "Release Version and Properties" | |
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" | |
echo "RELEASE_ASSETS_URL=${{ github.event.release.assets_url }}" >> "$GITHUB_ENV" | |
echo "release_assets_url=${{ github.event.release.assets_url }}" >> "$GITHUB_OUTPUT" | |
- name: Print output variables | |
run: | | |
echo BUILD_VERSION: ${{ steps.release_version.outputs.build_version }} | |
echo RELEASE_ASSETS_URL: ${{ steps.release_version.outputs.release_assets_url }} | |
Build: | |
needs: [ ReleaseVersion ] | |
uses: ./.github/workflows/build.yml | |
with: | |
build_version: ${{ needs.ReleaseVersion.outputs.build_version }} | |
release_build: true | |
secrets: inherit | |
permissions: | |
pull-requests: write | |
contents: write | |
UploadAssetsToRelease: | |
needs: [ ReleaseVersion, Build ] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
BUILD_VERSION: ${{ needs.ReleaseVersion.outputs.build_version }} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
env: | |
ARTIFACT_ID: ${{ needs.Build.outputs.build_artifact_id }} | |
- name: Upload artifact to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
./**/build/libs/* | |
./LICENSE | |
./README.md | |
Publish: | |
needs: [ ReleaseVersion, Build ] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
env: | |
BUILD_VERSION: ${{ needs.ReleaseVersion.outputs.build_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- name: Display structure of downloaded files | |
run: tree | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 # v3.1.0 | |
- name: Generate gradle.properties with version | |
run: | | |
echo "version=${BUILD_VERSION}" | |
echo "version=${BUILD_VERSION}" >> ./gradle.properties | |
# 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 }} | |
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }} | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GITHUB_DEPENDENCY_GRAPH_ENABLED: false | |
- 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 }} | |
GITHUB_DEPENDENCY_GRAPH_ENABLED: false | |
- name: Debug | |
if: ${{ failure() }} | |
run: | | |
echo "Failed" | |
tree |