Skip to content

Release bugfix version #8

Release bugfix version

Release bugfix version #8

Workflow file for this run

name: Release bugfix version
on:
workflow_dispatch:
inputs:
solr_version:
description: 'The upstream Solr release version'
required: true
default: '9.5.0'
type: string
patch_version:
description: 'The internal patch version suffix version'
required: true
default: 1
type: number
env:
VERSION: ${{ inputs.solr_version }}
VERSION_SUFFIX: otto-de.${{ inputs.patch_version }}
VERSION_FULL: ${{ inputs.solr_version }}-otto-de.${{ inputs.patch_version }}
jobs:
maven:
name: Build and release Maven artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
java-package: jdk
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
solr/distribution/build/release/maven
key: ${{ runner.os }}-gradle-release-${{ hashFiles('versions.lock') }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Gradle assemble release
run: ./gradlew assembleRelease -Dversion.release=${{ env.VERSION_FULL }}
- name: Upload artifacts to GitHub Package Repository
run: |
for artifact_id in `ls -1 ${MAVEN_ARTIFACTS}`; do
echo "Uploading ${artifact_id} to GitHub Package Repository ..."
export MAVEN_RELEASE_JARS="${MAVEN_ARTIFACTS}/${artifact_id}/${VERSION_FULL}"
mvn org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy-file \
-Durl=https://maven.pkg.github.com/${{ github.repository }} \
-DrepositoryId=github \
-Dfile=${MAVEN_RELEASE_JARS}/${artifact_id}-${VERSION_FULL}.jar \
-DpomFile=${MAVEN_RELEASE_JARS}/${artifact_id}-${VERSION_FULL}.pom \
-Dfiles=${MAVEN_RELEASE_JARS}/${artifact_id}-${VERSION_FULL}-sources.jar,${MAVEN_RELEASE_JARS}/${artifact_id}-${VERSION_FULL}-javadoc.jar \
-Dclassifiers=sources,javadoc \
-Dtypes=jar,jar
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_ARTIFACTS: solr/distribution/build/release/maven/org/apache/solr
docker:
name: Build and release Docker images
runs-on: ubuntu-latest
needs: maven
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
solr/distribution/build/release/maven
key: ${{ runner.os }}-gradle-release-${{ hashFiles('versions.lock') }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Gradle pre-build Docker image
run: ./gradlew solr:docker:docker -Dversion.release=${{ env.VERSION_FULL }} -Dmanifest.username=${{ github.actor }}
env:
SOLR_DOCKER_IMAGE_REPO: ${{ github.repository }}
SOLR_DOCKER_IMAGE_TAG: ${{ env.VERSION }}
SOLR_DOCKER_BASE_IMAGE: eclipse-temurin:21-jre-jammy
SOLR_DOCKER_DIST: full
- name: Prepare multi-arch Docker build
run: |
mkdir -p solr/packaging/build/distributions/context
tar xzvf solr/packaging/build/distributions/solr-${VERSION_FULL}.tgz \
-C solr/packaging/build/distributions/context
- name: Build and push to DockerHub registry
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: solr/packaging/build/distributions/context/solr-${{ env.VERSION_FULL }}/docker/Dockerfile
context: solr/packaging/build/distributions/context
tags: |
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
ghcr.io/${{ github.repository }}:${{ env.VERSION_FULL }}
release:
name: create release in GitHub
runs-on: ubuntu-latest
needs: docker
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
solr/distribution/build/release/maven
key: ${{ runner.os }}-gradle-release-${{ hashFiles('versions.lock') }}
- name: Create tag
uses: rickstaa/action-create-tag@v1
with:
tag: ${{ env.VERSION_FULL }}
tag_exists_error: false
message: |
Apache Solr custom release ${{ env.VERSION_FULL }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION_FULL }}
body: |
Apache Solr custom release ${{ env.VERSION_FULL }}
allowUpdates: true
artifacts: solr/distribution/build/release/maven/**/*.jar,solr/distribution/build/release/maven/**/*.pom
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}