Add publish/release actions for merge workflows#6
Open
eb-oss wants to merge 1 commit into
Open
Conversation
Signed-off-by: Eric Ball <eball@linuxfoundation.org> Change-Id: I05ef8897523e7c3d128767c3795b7e11f4b0169a
There was a problem hiding this comment.
Pull request overview
This PR adds new composite GitHub Actions under .github/actions/ to support publishing/releasing artifacts as part of merge/tag-based workflows (PyPI packages, Maven artifacts, Docker images, and GitHub Releases).
Changes:
- Added a PyPI publishing composite action gated on SemVer release tags.
- Added Maven publishing and GitHub Release composite actions.
- Added a Docker image build/push composite action plus READMEs for each action.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/actions/pypi-publish-action/README.md | Documents the new PyPI publish composite action. |
| .github/actions/pypi-publish-action/action.yaml | Implements SemVer-tag-gated PyPI build/upload flow across module directories. |
| .github/actions/maven-publish-action/README.md | Documents the new Maven publish composite action. |
| .github/actions/maven-publish-action/action.yaml | Implements JDK setup, optional GPG import, settings handling, and mvn deploy. |
| .github/actions/github-release-action/README.md | Documents the new GitHub release composite action. |
| .github/actions/github-release-action/action.yaml | Implements artifact build/checksum generation and gh release create. |
| .github/actions/docker-publish-action/README.md | Documents the new Docker build/push composite action. |
| .github/actions/docker-publish-action/action.yaml | Implements docker login, build/push for branch and git tags, and logout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+36
to
+50
| TAG=$(git tag --points-at HEAD | head -n1 || true) | ||
| if [ -z "$TAG" ]; then | ||
| echo "No git tag on HEAD, skipping publish" | ||
| echo "is-release=false" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| # Match vX.Y.Z or X.Y.Z (SemVer release, no pre-release suffix) | ||
| if [[ "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "Found SemVer release tag: $TAG" | ||
| echo "is-release=true" >> "$GITHUB_OUTPUT" | ||
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "Tag '$TAG' is not a SemVer release version, skipping publish" | ||
| echo "is-release=false" >> "$GITHUB_OUTPUT" | ||
| fi |
Comment on lines
+67
to
+80
| set -eu -o pipefail | ||
| IFS='|' read -ra DIRS <<< "${{ inputs.module-dirs }}" | ||
| for dir in "${DIRS[@]}"; do | ||
| dir=$(echo "$dir" | xargs) # trim whitespace | ||
| echo "::group::Publishing module in: $dir" | ||
|
|
||
| if [ ! -f "$dir/setup.py" ]; then | ||
| echo "ERROR: setup.py not found in $dir" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Installing build dependencies..." | ||
| pip install --upgrade pip setuptools wheel twine build | ||
|
|
Comment on lines
+27
to
+37
| | Input | Required | Default | Description | | ||
| |-------|----------|---------|-------------| | ||
| | `java-version` | No | `11` | Java version to use | | ||
| | `java-distribution` | No | `temurin` | Java distribution | | ||
| | `maven-goals` | No | `-Prelease clean deploy` | Maven goals to execute | | ||
| | `maven-settings-file` | No | `""` | Path to custom Maven settings.xml | | ||
| | `gpg-private-key` | No | `""` | GPG private key for signing | | ||
| | `gpg-passphrase` | No | `""` | GPG passphrase | | ||
| | `server-id` | No | `ossrh` | Maven server ID for deployment | | ||
| | `server-username` | **Yes** | — | Maven server username | | ||
| | `server-password` | **Yes** | — | Maven server password | |
Comment on lines
+90
to
+95
| MAVEN_ARGS="-s ${{ github.workspace }}/settings.xml" | ||
| if [ -n "$GPG_PASSPHRASE" ]; then | ||
| MAVEN_ARGS="$MAVEN_ARGS -Dgpg.passphrase=$GPG_PASSPHRASE" | ||
| fi | ||
| echo "Running: mvn $MAVEN_ARGS ${{ inputs.maven-goals }}" | ||
| mvn $MAVEN_ARGS ${{ inputs.maven-goals }} |
Comment on lines
+54
to
+61
| # Build release artifacts | ||
| make $RELEASE_TARGETS | ||
|
|
||
| # Generate SHA256 checksums for all artifacts | ||
| CHECKSUM_FILE="checksums-sha256.txt" | ||
| sha256sum $ARTIFACT_GLOB > "$CHECKSUM_FILE" | ||
| echo "Generated checksums:" | ||
| cat "$CHECKSUM_FILE" |
Comment on lines
+74
to
+80
| gh release create "$VERSION" \ | ||
| $ARTIFACT_GLOB \ | ||
| "$CHECKSUM_FILE" \ | ||
| --title "$VERSION" \ | ||
| --notes "$RELEASE_NOTES" \ | ||
| --generate-notes \ | ||
| $DRAFT_FLAG |
Comment on lines
+28
to
+35
| | Input | Required | Default | Description | | ||
| |-------|----------|---------|-------------| | ||
| | `docker-registry` | Yes | — | Docker registry URL | | ||
| | `docker-repository` | Yes | — | Docker repository prefix | | ||
| | `image-name` | Yes | — | Name of the Docker image | | ||
| | `extra-environment-vars` | No | `""` | Extra environment variables for make commands | | ||
| | `docker-username` | Yes | — | Docker registry username | | ||
| | `docker-password` | Yes | — | Docker registry password | |
Comment on lines
+51
to
+66
| - name: Build Docker image with branch tag | ||
| shell: bash | ||
| run: | | ||
| set -eu -o pipefail | ||
| BRANCH_NAME="${GITHUB_REF_NAME}" | ||
| DOCKER_REGISTRY="${{ inputs.docker-registry }}" | ||
| DOCKER_REPOSITORY="${{ inputs.docker-repository }}" | ||
| IMAGE_NAME="${{ inputs.image-name }}" | ||
|
|
||
| echo "Building image with branch tag: ${BRANCH_NAME}" | ||
| ${{ inputs.extra-environment-vars }} \ | ||
| DOCKER_TAG="${BRANCH_NAME}" \ | ||
| DOCKER_REGISTRY="${DOCKER_REGISTRY}" \ | ||
| DOCKER_REPOSITORY="${DOCKER_REPOSITORY}" \ | ||
| IMAGE_NAME="${IMAGE_NAME}" \ | ||
| make docker-build |
Comment on lines
+95
to
+110
| - name: Push Docker image with branch tag | ||
| shell: bash | ||
| run: | | ||
| set -eu -o pipefail | ||
| BRANCH_NAME="${GITHUB_REF_NAME}" | ||
| DOCKER_REGISTRY="${{ inputs.docker-registry }}" | ||
| DOCKER_REPOSITORY="${{ inputs.docker-repository }}" | ||
| IMAGE_NAME="${{ inputs.image-name }}" | ||
|
|
||
| echo "Pushing image with branch tag: ${BRANCH_NAME}" | ||
| ${{ inputs.extra-environment-vars }} \ | ||
| DOCKER_TAG="${BRANCH_NAME}" \ | ||
| DOCKER_REGISTRY="${DOCKER_REGISTRY}" \ | ||
| DOCKER_REPOSITORY="${DOCKER_REPOSITORY}" \ | ||
| IMAGE_NAME="${IMAGE_NAME}" \ | ||
| make docker-push |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.