This is an automated email from the ASF dual-hosted git repository.
lewismc pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika-helm.git
The following commit(s) were added to refs/heads/main by this push:
new c0fc0d7 TIKA-4678 Create GitHub Action automation to publish
tika-helm to Artfactory on each merge to main branch (#33)
c0fc0d7 is described below
commit c0fc0d74fca37ed7fd0864c2d693d843acd22fd4
Author: Lewis John McGibbney <[email protected]>
AuthorDate: Fri Apr 3 17:22:05 2026 -0700
TIKA-4678 Create GitHub Action automation to publish tika-helm to
Artfactory on each merge to main branch (#33)
---
.github/workflows/install-test-chart.yaml | 138 +++++++++++++++++++++
.github/workflows/lint-test.yaml | 16 +--
...ease.yaml => publish-artifactory-on-merge.yaml} | 80 ++++++------
.github/workflows/release.yaml | 2 +-
README.md | 4 +-
README.md.gotmpl | 4 +-
6 files changed, 196 insertions(+), 48 deletions(-)
diff --git a/.github/workflows/install-test-chart.yaml
b/.github/workflows/install-test-chart.yaml
new file mode 100644
index 0000000..ba83fd9
--- /dev/null
+++ b/.github/workflows/install-test-chart.yaml
@@ -0,0 +1,138 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Reusable workflow: create a kind cluster, install the tika Helm chart
+# (from Artifactory Helm OCI by version or from repo at ref), then run helm
test.
+#
+# Call with either:
+# - chart_version: install from Artifactory (requires ARTIFACTORY_* secrets)
+# - ref: install from repo at this ref (e.g. github.sha)
+
+name: Install and Test Chart
+
+on:
+ workflow_call:
+ inputs:
+ chart_version:
+ description: 'Chart version to install from Artifactory Helm OCI (e.g.
3.2.3-abc1234). Omit to install from repo.'
+ required: false
+ type: string
+ ref:
+ description: 'Git ref to checkout and install from (e.g. github.sha).
Required when chart_version is not set.'
+ required: false
+ type: string
+ secrets:
+ ARTIFACTORY_USERNAME:
+ description: 'Apache JFrog Artifactory username (required when
chart_version is set)'
+ required: false
+ ARTIFACTORY_PASSWORD:
+ description: 'Apache JFrog Artifactory password (required when
chart_version is set)'
+ required: false
+
+permissions:
+ contents: read
+
+jobs:
+ install-test:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ if: inputs.chart_version == ''
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.ref }}
+
+ - name: Set up Helm
+ uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2
+
+ - name: Create kind cluster
+ uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab #
v1.13.0
+
+ - name: Log in to Helm OCI and pull chart
+ if: inputs.chart_version != ''
+ env:
+ HELM_REPO_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
+ HELM_REPO_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
+ run: |
+ echo "$HELM_REPO_PASSWORD" | helm registry login apache.jfrog.io \
+ --username "$HELM_REPO_USERNAME" --password-stdin
+ helm pull oci://apache.jfrog.io/artifactory/tika-helm/tika \
+ --version "${{ inputs.chart_version }}"
+
+ - name: Install chart from Artifactory
+ if: inputs.chart_version != ''
+ run: |
+ helm install tika tika-${{ inputs.chart_version }}.tgz \
+ -n tika-test --create-namespace \
+ --wait --timeout 5m
+
+ - name: Install chart from repo
+ if: inputs.chart_version == ''
+ run: |
+ helm install tika . \
+ -n tika-test --create-namespace \
+ --wait --timeout 5m
+
+ - name: Run helm test
+ run: helm test tika -n tika-test --timeout 3m
+
+ - name: Verify Tika HTTP root
+ run: |
+ sed 's/^ //' <<'JOB' | kubectl apply -f - -n tika-test
+ apiVersion: batch/v1
+ kind: Job
+ metadata:
+ name: tika-http-root-check
+ spec:
+ backoffLimit: 2
+ template:
+ spec:
+ restartPolicy: Never
+ containers:
+ - name: curl
+ image: curlimages/curl:latest
+ command: ["sh", "-c"]
+ args:
+ - |
+ code=$(curl -sf -o /dev/null -w "%{http_code}"
http://tika:9998/)
+ [ "$code" = "200" ] || { echo "Expected HTTP 200, got
$code"; exit 1; }
+ JOB
+ kubectl wait --for=condition=complete job/tika-http-root-check -n
tika-test --timeout=120s
+ kubectl delete job tika-http-root-check -n tika-test
--ignore-not-found
+
+ - name: Verify Tika /tika endpoint
+ run: |
+ sed 's/^ //' <<'JOB' | kubectl apply -f - -n tika-test
+ apiVersion: batch/v1
+ kind: Job
+ metadata:
+ name: tika-endpoint-check
+ spec:
+ backoffLimit: 2
+ template:
+ spec:
+ restartPolicy: Never
+ containers:
+ - name: curl
+ image: curlimages/curl:latest
+ command: ["sh", "-c"]
+ args:
+ - |
+ # GET /tika returns 200 (OK) or 405 (Method Not
Allowed) when endpoint is up
+ code=$(curl -s -o /dev/null -w "%{http_code}"
http://tika:9998/tika)
+ case "$code" in 200|405) exit 0 ;; *) echo "Unexpected
/tika status: $code"; exit 1 ;; esac
+ JOB
+ kubectl wait --for=condition=complete job/tika-endpoint-check -n
tika-test --timeout=120s
+ kubectl delete job tika-endpoint-check -n tika-test
--ignore-not-found
diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml
index f084f3a..d9115cb 100644
--- a/.github/workflows/lint-test.yaml
+++ b/.github/workflows/lint-test.yaml
@@ -25,6 +25,8 @@ on:
jobs:
lint-test:
runs-on: ubuntu-latest
+ outputs:
+ changed: ${{ steps.list-changed.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -45,9 +47,6 @@ jobs:
- name: Run chart-testing (lint)
run: ct lint --target-branch ${{
github.event.repository.default_branch }} --charts .
shell: bash
- - name: Create kind cluster
- uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab #
v1.13.0
- if: steps.list-changed.outputs.changed == 'true'
- name: Install helm-unittest
run: |
helm plugin uninstall unittest 2>/dev/null || true
@@ -56,7 +55,10 @@ jobs:
- name: Run unit tests
run: helm unittest .
shell: bash
- - name: Run chart-testing (install)
- if: steps.list-changed.outputs.changed == 'true'
- run: ct install --target-branch ${{
github.event.repository.default_branch }} --charts .
- shell: bash
+
+ install-test:
+ needs: lint-test
+ if: needs.lint-test.outputs.changed == 'true'
+ uses: ./.github/workflows/install-test-chart.yaml
+ with:
+ ref: ${{ github.sha }}
diff --git a/.github/workflows/release.yaml
b/.github/workflows/publish-artifactory-on-merge.yaml
similarity index 57%
copy from .github/workflows/release.yaml
copy to .github/workflows/publish-artifactory-on-merge.yaml
index 32196c3..005f12b 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/publish-artifactory-on-merge.yaml
@@ -13,77 +13,72 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# This workflow creates a GitHub Release and publishes the Helm chart to the
-# Apache JFrog Artifactory Helm OCI repository whenever a v* tag is pushed.
+# This workflow publishes the Helm chart to Apache JFrog (Helm OCI) on every
+# push to main. Published versions use the form {chart_version}-{short_sha}
+# and are not official releases.
#
-# Publishing uses JFrog CLI (`jf helm`) so the chart push is tied to
Artifactory
-# build-info: CI environment and Git metadata are attached, then the build is
-# published for traceability (Builds UI, Xray, promotion flows, etc.).
+# Publishing uses JFrog CLI (`jf helm`) with build-info (env + Git) and
+# `jf rt build-publish`, matching the tagged release workflow.
#
# Required GitHub Secrets:
# ARTIFACTORY_USERNAME -- Apache JFrog Artifactory username
# ARTIFACTORY_PASSWORD -- Apache JFrog Artifactory password
#
-# Prerequisite: The Helm OCI repository must exist in Apache JFrog (Tika
project), e.g. tika-helm.
-# Confirm the repo key and project with Apache Infra and set HELM_OCI_REPO /
JF_PROJECT_KEY if different.
+# Prerequisite: Helm OCI repo and project match release.yaml (HELM_OCI_REPO,
JF_PROJECT_KEY).
-name: Release Helm Chart
+name: Publish Helm Chart to Artifactory on Merge
on:
push:
- tags:
- - 'v*'
+ branches:
+ - main
+
+concurrency:
+ group: publish-artifactory-${{ github.ref }}
+ cancel-in-progress: false
permissions:
- contents: write
+ contents: read
env:
JF_URL: https://apache.jfrog.io
HELM_OCI_REPO: tika-helm
JF_PROJECT_KEY: tika
- JF_BUILD_NAME: tika-helm
+ JF_BUILD_NAME: tika-helm-main
JF_BUILD_NUMBER: ${{ github.run_id }}
jobs:
- release:
+ publish:
runs-on: ubuntu-latest
+ outputs:
+ publish_version: ${{ steps.publish-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- - name: Extract versions from Chart.yaml
+ - name: Extract version from Chart.yaml
id: versions
run: |
CHART_VERSION=$(grep '^version:' Chart.yaml | sed 's/version:
*"\(.*\)"/\1/')
- APP_VERSION=$(grep '^appVersion:' Chart.yaml | sed 's/appVersion:
*"\(.*\)"/\1/')
echo "chart_version=$CHART_VERSION" >> "$GITHUB_OUTPUT"
- echo "app_version=$APP_VERSION" >> "$GITHUB_OUTPUT"
shell: bash
- - name: Create GitHub Release
- uses: softprops/action-gh-release@v2
- with:
- tag_name: ${{ github.ref_name }}
- name: "tika-helm ${{ github.ref_name }}"
- body: |
- ## tika-helm ${{ github.ref_name }}
-
- **Chart version:** `${{ steps.versions.outputs.chart_version }}`
- **App version (Docker image tag):** `${{
steps.versions.outputs.app_version }}`
-
- **Install from Helm OCI:** `helm install tika
oci://apache.jfrog.io/artifactory/${{ env.HELM_OCI_REPO }}/tika --version ${{
steps.versions.outputs.chart_version }}`
-
- **Artifactory build:** `${{ env.JF_BUILD_NAME }}` / `${{
env.JF_BUILD_NUMBER }}` (project `${{ env.JF_PROJECT_KEY }}`)
+ - name: Set publish version
+ id: publish-version
+ run: |
+ PUBLISH_VERSION="${{ steps.versions.outputs.chart_version
}}-${GITHUB_SHA:0:7}"
+ echo "version=$PUBLISH_VERSION" >> "$GITHUB_OUTPUT"
+ shell: bash
- [View available tags on Docker
Hub](https://hub.docker.com/r/apache/tika/tags)
- generate_release_notes: true
- draft: false
- prerelease: false
+ - name: Override version in Chart.yaml
+ run: |
+ sed -i "s/^version: .*/version: \"${{
steps.publish-version.outputs.version }}\"/" Chart.yaml
+ shell: bash
- name: Set up Helm
- uses: azure/setup-helm@v4
+ uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2
- name: Set up JFrog CLI
uses: jfrog/setup-jfrog-cli@v4
@@ -94,7 +89,7 @@ jobs:
jfrog-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Package Helm chart
- run: helm package . --version ${{ steps.versions.outputs.chart_version
}}
+ run: helm package .
shell: bash
- name: Log in to Helm OCI registry (JFrog CLI)
@@ -109,9 +104,9 @@ jobs:
- name: Push Helm chart (JFrog CLI, build-info)
env:
- CHART_VERSION: ${{ steps.versions.outputs.chart_version }}
+ PUBLISH_VERSION: ${{ steps.publish-version.outputs.version }}
run: |
- jf helm push "tika-${CHART_VERSION}.tgz" \
+ jf helm push "tika-${PUBLISH_VERSION}.tgz" \
"oci://apache.jfrog.io/artifactory/${HELM_OCI_REPO}" \
--build-name="${JF_BUILD_NAME}" \
--build-number="${JF_BUILD_NUMBER}" \
@@ -124,3 +119,12 @@ jobs:
jf rt build-add-git "${JF_BUILD_NAME}" "${JF_BUILD_NUMBER}"
jf rt build-publish --project="${JF_PROJECT_KEY}" "${JF_BUILD_NAME}"
"${JF_BUILD_NUMBER}"
shell: bash
+
+ test-published:
+ needs: publish
+ uses: ./.github/workflows/install-test-chart.yaml
+ with:
+ chart_version: ${{ needs.publish.outputs.publish_version }}
+ secrets:
+ ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
+ ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 32196c3..ae6e0cf 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -83,7 +83,7 @@ jobs:
prerelease: false
- name: Set up Helm
- uses: azure/setup-helm@v4
+ uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2
- name: Set up JFrog CLI
uses: jfrog/setup-jfrog-cli@v4
diff --git a/README.md b/README.md
index b41993c..336059a 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,8 @@ in which case you may need to augment the commands below.
* If the registry requires authentication (e.g. for private access), log in
first:
`helm registry login apache.jfrog.io --username <your-username> --password
<your-password>`
+* **Snapshot builds from `main`:** Each merge publishes a chart to the same
OCI repository with version `{chart_version}-{git_short_sha}` (for example
`3.2.3-a1b2c3d`). These are not official releases. Use `helm install` or `helm
pull` with that version and the OCI URL below.
+
* Install from OCI (replace `<version>` with the chart version you want, e.g.
`3.2.3`):
- with Helm 3: `helm install tika
oci://apache.jfrog.io/artifactory/tika-helm/tika --version <version> --set
image.tag=<app-version> -n tika-test`
- Example:
@@ -73,7 +75,7 @@ while true; do kubectl --namespace tika-test port-forward
$POD_NAME 9998:$CONTAI
```
... this should keep `kubectl` reconnecting on connection lost.
-**Note:** The classic Helm repository (`helm repo add tika
https://apache.jfrog.io/artifactory/tika`) is deprecated and no longer receives
new chart releases. Please use the Helm OCI install above.
+**Note:** The classic Helm repository (`helm repo add tika
https://apache.jfrog.io/artifactory/tika`) is deprecated. Official releases and
`main`-branch snapshot charts are published to the Helm OCI repository above.
### Install development version using main branch
diff --git a/README.md.gotmpl b/README.md.gotmpl
index c7b66e7..4f91c22 100644
--- a/README.md.gotmpl
+++ b/README.md.gotmpl
@@ -47,6 +47,8 @@ in which case you may need to augment the commands below.
* If the registry requires authentication (e.g. for private access), log in
first:
`helm registry login apache.jfrog.io --username <your-username> --password
<your-password>`
+* **Snapshot builds from `main`:** Each merge publishes a chart to the same
OCI repository with version `{chart_version}-{git_short_sha}` (for example
`3.2.3-a1b2c3d`). These are not official releases. Use `helm install` or `helm
pull` with that version and the OCI URL below.
+
* Install from OCI (replace `<version>` with the chart version you want, e.g.
`3.2.3`):
- with Helm 3: `helm install tika
oci://apache.jfrog.io/artifactory/tika-helm/tika --version <version> --set
image.tag=<app-version> -n tika-test`
- Example:
@@ -73,7 +75,7 @@ while true; do kubectl --namespace tika-test port-forward
$POD_NAME 9998:$CONTAI
```
... this should keep `kubectl` reconnecting on connection lost.
-**Note:** The classic Helm repository (`helm repo add tika
https://apache.jfrog.io/artifactory/tika`) is deprecated and no longer receives
new chart releases. Please use the Helm OCI install above.
+**Note:** The classic Helm repository (`helm repo add tika
https://apache.jfrog.io/artifactory/tika`) is deprecated. Official releases and
`main`-branch snapshot charts are published to the Helm OCI repository above.
### Install development version using main branch