support Auto-update OpenTelemetry Extension (#19) #45
This file contains 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
name: "Publish Java Auto-Instrumentation" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- '.github/workflows/publish-autoinstrumentation-java.yaml' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
publish: | |
runs-on: ubuntu-22.04 | |
env: | |
TAG: ${{ github.sha }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Read version | |
id: read-version | |
run: | | |
echo "VERSION=$(grep -Po "opentelemetrySdk : \"\K[0-9]+.[0-9]+.[0-9]+" build.gradle)" >> $GITHUB_ENV | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/openinsight-proj/autoinstrumentation-java | |
tags: | | |
type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }}-${{ env.TAG }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Package Registry | |
uses: docker/login-action@v3 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.ACTIONS_TOKEN }} | |
- name: Grable Build | |
run: | | |
./gradlew extendedAgent | |
mv build/libs/* autoinstrumentation/ | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: autoinstrumentation | |
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le | |
push: ${{ github.event_name == 'push' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |