Skip to content

v1.11.5

v1.11.5 #13

# This workflow runs when a GitHub release is published.
#
# It validates that the tag correctly matches the library version, and then publishes
# artifacts for the release. Currently, this includes uploading the compiled Jar to
# the GitHub release. However, it should be extended to also include PGP signing and
# uploading to Maven Central.
#
# This workflow is almost a reusable workflow that can be used by any of our Gradle/JVM
# libraries. In order to make it reusable, we need to move it to a separate repo, update
# the workflow trigger ('on') to be 'workflow_call', and define inputs for any context
# that needs to be passed in.
#
# See https://docs.github.com/en/actions/using-workflows/reusing-workflows
#
# TODO: Consider whether we should merge this with the "prepare-release" workflow rather
# than having separate workflows.
name: Publish Artifacts for Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
publish-to-github-release:

Check failure on line 28 in .github/workflows/publish-release-artifacts.yml

View workflow run for this annotation

GitHub Actions / Publish Artifacts for Release

Invalid workflow file

The workflow is not valid. .github/workflows/publish-release-artifacts.yml (Line: 28, Col: 3): The workflow must contain at least one job with no dependencies.
# only run if `check-tag` completes successfully
needs: check-tag
runs-on: "codebuild-ion-java-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large"
permissions:
contents: write
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v3.6.0
with:
submodules: recursive
- name: Validate project version matches tag
shell: bash
run: |
RELEASE_TAG=${GITHUB_REF#refs/tags/}
# the tag should start with `v`, so prepend `v` to the contents of project.version
PROJECT_VERSION="v$(<project.version)"
echo "Project Version: $PROJECT_VERSION"
echo "Release Tag: $RELEASE_TAG"
[ "$PROJECT_VERSION" = "$RELEASE_TAG" ] || exit 1
- uses: gradle/gradle-build-action@e2097ccd7e8ed48671dc068ac4efa86d25745b39 # v3.3.1
with:
arguments: build cyclonedxBom publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Upload Jar to GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TODO - reusability
# the location of the library(s) should be configurable as an input
# parameter rather than being hard coded as `build/libs/ion-java...`
# It may also need to be able to upload more than one file.
run: |
gh release upload "v$(<project.version)" "build/libs/ion-java-$(<project.version).jar"
gh release upload "v$(<project.version)" "build/reports/bom.json"