Skip to content

Release

Release #18

Workflow file for this run

name: Release
on:
push:
tags:
# Run on any pushed tag like v2.0.0
- 'v*.*.*'
workflow_dispatch:
# Cancel any already running builds with that git reference
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Ensure that all required checks pass
run: ./gradlew check
- name: Assemble the library for use in GitHub release
run: ./gradlew assemble generatePomFileForBigbonePublication
- name: Publish the library
run: ./gradlew publish
env:
SONATYPE_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: ZIP files
id: zip-files
run: |
tagName=${{ github.ref_name }}
# Format the current date like 20231105.180259
formattedDate=$(date +%Y%m%d.%H%M%S)
archiveName=BigBone-$tagName-$formattedDate.zip
# Get all JARs and POM files and zip them into an archive with archiveName
find bigbone/build/libs bigbone/build/publications -type f \( -name "*.jar" -o -name "*pom*.xml" \) -print | zip $archiveName -@
# Save archive name for reuse in later action steps
echo "zipArchive=$archiveName" >> $GITHUB_OUTPUT
- name: Create a GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
prerelease: true
draft: true
fail_on_unmatched_files: true
files: ./${{ steps.zip-files.outputs.zipArchive }}
generate_release_notes: true