Skip to content

Release v0.113.0 (#5641) #293

Release v0.113.0 (#5641)

Release v0.113.0 (#5641) #293

name: splunk-ta-otel-build
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/splunk-ta-otel.yml'
- 'packaging/technical-addon/**'
- 'cmd/**'
- 'internal/**'
- 'pkg/**'
- 'tests/**'
- '!**.md'
concurrency:
group: splunk-technical-addon-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GO_VERSION: 1.22.7
jobs:
setup-environment:
name: setup-environment
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: '**/go.sum'
- name: Installing dependency
run: |
make install-tools
test:
name: test
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: '**/go.sum'
- name: Build & Package TA
run: |
set -o pipefail
make -e package-technical-addon
check_changes:
runs-on: ubuntu-latest
outputs:
ta_packaging_change: ${{ steps.filter.outputs.ta_packaging_change }}
ta_workflow_change: ${{ steps.filter.outputs.ta_workflow_change }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Get changed files
id: changed-files
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "files=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_OUTPUT
else
echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_OUTPUT
fi
- name: Filter paths
id: filter
run: |
files="${{ steps.changed-files.outputs.files }}"
if echo "$files" | grep -qE "packaging/technical-addon"; then
echo "ta_packaging_change=true" >> $GITHUB_OUTPUT
else
echo "ta_packaging_change=false" >> $GITHUB_OUTPUT
fi
if echo "$files" | grep -qE ".github/workflows/splunk-ta-otel.yml"; then
echo "ta_workflow_change=true" >> $GITHUB_OUTPUT
else
echo "ta_workflow_change=false" >> $GITHUB_OUTPUT
fi
distribute-ta:
name: "distribute-ta" # what gets run to package in gitlab
runs-on: ubuntu-latest
needs: [setup-environment, check_changes]
if: needs.check_changes.outputs.ta_packaging_change == 'true' || needs.check_changes.outputs.ta_workflow_change == 'true'
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
- name: Build & Package TA
run: |
set -o pipefail
PLATFORM="all" make -e distribute-ta