1+ name : 🔄 CI | Bump Component Versions
2+
3+ on :
4+ workflow_dispatch :
5+ schedule :
6+ # Scheduled to run every hour on every day-of-week from Monday through Friday.
7+ - cron : ' 0 * * * 1-5'
8+
9+ jobs :
10+ bump :
11+ name : Bump Component Versions
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout
15+ uses : actions/checkout@v4
16+ with :
17+ fetch-depth : 0 # required for tag metadata
18+
19+ - name : Setup Go
20+ uses : actions/setup-go@v5
21+ with :
22+ go-version : ' 1.23'
23+ check-latest : true
24+
25+ - name : Tidy go.mod files
26+ run : go mod tidy
27+
28+ - name : Bump component versions
29+ id : bump_component_versions
30+ run : |
31+ output=$(./scripts/bump-component-versions.sh)
32+ echo "output=${output}" >> $GITHUB_OUTPUT
33+ # Check for unstaged changes
34+ if git diff --quiet; then
35+ echo "No unstaged changes found. Exiting."
36+ echo "has_changes=false" >> $GITHUB_OUTPUT
37+ else
38+ echo "Unstaged changes found. Continuing..."
39+ echo "has_changes=true" >> $GITHUB_OUTPUT
40+ fi
41+
42+ - name : Setup ENV
43+ if : steps.bump_component_versions.outputs.has_changes == 'true'
44+ env :
45+ GITHUB_TOKEN : ${{ secrets.RELEASE_TOKEN }}
46+ run : |
47+ gh_username=$(gh api user | jq -r '.login')
48+ output=$(echo "${{ steps.bump_component_versions.outputs.output }}")
49+ echo "gh_username=${gh_username}" >> $GITHUB_ENV
50+ next_beta_core=$(echo "${output}" | jq -r '.nextVersions.betaCoreVersion')
51+ current_beta_core=$(echo "${output}" | jq -r '.currentVersions.betaCoreVersion')
52+ echo "next_beta_core=${next_beta_core}" >> $GITHUB_ENV
53+ echo "current_beta_core=${current_beta_core}" >> $GITHUB_ENV
54+ echo "branch=otel-release/${next_beta_core}" >> $GITHUB_ENV
55+
56+ - name : Commit Component Version Bump
57+ if : steps.bump_component_versions.outputs.has_changes == 'true'
58+ env :
59+ GITHUB_TOKEN : ${{ secrets.RELEASE_TOKEN }}
60+ run : |
61+ git switch -c ${{ env.branch }}
62+ git config --global user.name '${{ env.gh_username }}'
63+ git config --global user.email '${{ env.gh_username }}@users.noreply.github.com'
64+
65+ git add --all
66+ git commit -m "feat: Bump otel component versions from ${{ env.current_beta_core }} to ${{ env.next_beta_core }}"
67+ git push origin ${{ env.branch }}
68+
69+ - name : Issue PR
70+ if : ${{ !env.ACT && steps.bump_component_versions.outputs.has_changes == 'true' }}
71+ env :
72+ GITHUB_TOKEN : ${{ secrets.RELEASE_TOKEN }}
73+ run : |
74+ gh pr create --title "Bump OTEL beta core to ${{ env.next_beta_core }}" \
75+ --body "Updates the version of the otel beta core from ${{ env.current_beta_core }} to ${{ env.next_beta_core }}." \
76+ --repo ${{ github.event.repository.name }} \
77+ --base main --head ${{ github.event.repository.name }}:${{ env.branch }}
0 commit comments