Skip to content

Release v1.30.0

Release v1.30.0 #16

name: publish splunk-otel-java docker image to ghcr
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- uses: docker/setup-buildx-action@v3
- name: Get the latest release version
run: |
if [[ "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.x$ ]]; then
# get the latest tag on the release branch
RELEASE_VERSION="$(git describe --abbrev=0)"
elif [[ "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
RELEASE_VERSION="$GITHUB_REF_NAME"
else
echo "This script can only be run on the tag or a release branch"
exit 1
fi
echo RELEASE_VERSION=${RELEASE_VERSION} >> $GITHUB_ENV
- name: Set the major version number
run: echo MAJOR_VERSION=${GITHUB_REF_NAME} | sed -e 's/\..*//' >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and publish container
uses: docker/build-push-action@v5.1.0
with:
push: true
file: Dockerfile-ghcr
platforms: linux/amd64,linux/arm64,linux/ppc64le
build-args: |
RELEASE_VER=${{ env.RELEASE_VERSION }}
tags: |
ghcr.io/signalfx/splunk-otel-java/splunk-otel-java:latest
ghcr.io/signalfx/splunk-otel-java/splunk-otel-java:${{ env.MAJOR_VERSION }}
ghcr.io/signalfx/splunk-otel-java/splunk-otel-java:${{ env.RELEASE_VERSION }}