v1.0.0 #1
Workflow file for this run
This file contains hidden or 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' | |
| on: | |
| release: | |
| types: [ published ] | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| outputs: | |
| ARTIFACT_PATH: ${{ steps.prepare_artifact_metadata.outputs.ARTIFACT_PATH }} | |
| ARTIFACT_NAME: ${{ steps.prepare_artifact_metadata.outputs.ARTIFACT_NAME }} | |
| JAVADOC_PATH: ${{ steps.prepare_artifact_metadata.outputs.JAVADOC_PATH }} | |
| JAVADOC_NAME: ${{ steps.prepare_artifact_metadata.outputs.JAVADOC_NAME }} | |
| API_PATH: ${{ steps.prepare_artifact_metadata.outputs.API_PATH }} | |
| API_NAME: ${{ steps.prepare_artifact_metadata.outputs.API_NAME }} | |
| VERSION: ${{ steps.prepare_artifact_metadata.outputs.VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 50 | |
| - run: git fetch origin --tags | |
| shell: bash | |
| - uses: ./.github/actions/gradle-setup | |
| - name: Build with Gradle | |
| run: ./gradlew printProjectVersion build publish -x check --max-workers 1 | |
| env: | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSWORD }} | |
| - name: Prepare artifact metadata. Note that VERSION is set by the gradle script. | |
| id: prepare_artifact_metadata | |
| run: | | |
| echo ARTIFACT_PATH=./build/libs/yoga-${VERSION}.jar >> $GITHUB_OUTPUT | |
| echo ARTIFACT_NAME=yoga-${VERSION}.jar >> $GITHUB_OUTPUT | |
| echo JAVADOC_PATH=./build/libs/yoga-${VERSION}-javadoc.jar >> $GITHUB_OUTPUT | |
| echo JAVADOC_NAME=yoga-${VERSION}-javadoc.jar >> $GITHUB_OUTPUT | |
| echo VERSION=${VERSION} >> $GITHUB_OUTPUT | |
| - name: Archive build results | |
| run: tar -I zstd -cf build.tar.zst build/libs build/repo | |
| - name: Upload build and gradle folders | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: build.tar.zst | |
| if-no-files-found: error | |
| retention-days: 3 | |
| upload-release-artifacts: | |
| name: Upload Release Artifacts | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| - name: Unpack build artifact | |
| run: tar axf build.tar.zst | |
| - name: Upload Release Artifact | |
| uses: actions/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ needs.build.outputs.ARTIFACT_PATH }} | |
| asset_name: ${{ needs.build.outputs.ARTIFACT_NAME }} | |
| asset_content_type: application/zip | |
| - name: Upload Javadocs Artifact | |
| uses: actions/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ needs.build.outputs.JAVADOC_PATH }} | |
| asset_name: ${{ needs.build.outputs.JAVADOC_NAME }} | |
| asset_content_type: application/zip | |
| deploy-github-packages: | |
| name: Deploy to Github Packages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| - name: Unpack build artifact | |
| run: tar axf build.tar.zst | |
| - name: Validate artifacts exist | |
| run: test -d ./build | |
| - name: Publish to Github Packages | |
| uses: AppliedEnergistics/maven-publish-action@main | |
| with: | |
| local-repository-path: build/repo | |
| remote-repository-url: https://maven.pkg.github.com/AppliedEnergistics/yoga/ | |
| remote-repository-username: ${{ github.actor }} | |
| remote-repository-password: ${{ github.token }} | |
| deploy-maven-central: | |
| name: Deploy to Maven Central | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| - name: Unpack build artifact | |
| run: tar axf build.tar.zst | |
| - name: Validate artifacts exist | |
| run: test -d ./build | |
| - name: Publish to Maven Central | |
| uses: AppliedEnergistics/maven-central-publish-action@main | |
| with: | |
| local-repository-path: build/repo | |
| username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} |