v2.10.0 #2
Workflow file for this run
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | |
name: release | |
on: | |
release: | |
types: [prereleased, released] | |
concurrency: | |
group: release | |
cancel-in-progress: false | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: GIT Checkout | |
uses: actions/checkout@v4 | |
# we pin v0.8.16 as 'latest' tag. | |
# in github UI the release may be marked as latest. So do it as first step of the workflow so there is less time | |
# that this release is marked as latest | |
# this is a workaround for: | |
# in November 2024 we changed the version of the agent that the plugin downloads from latest to a specific version. | |
# for that we needed to pin v0.8.16 as latest so that older plugin version will still use this release. | |
# todo: this step can be removed after all users upgraded the plugin, probably around March 25. | |
- name: pin v0.8.16 as latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release edit v0.8.16 --latest | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. | |
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | |
- name: Build with Gradle Wrapper | |
run: ./gradlew build -PNoArchiveVersion | |
- name: Upload Release Asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload ${{ github.event.release.tag_name }} ./agent-extension/build/libs/digma-otel-agent-extension.jar | |
update-to-next-version: | |
needs: [ release ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Increment version | |
run: | | |
./gradlew --no-configuration-cache incrementSemanticVersionPatch | |
./gradlew --no-configuration-cache printSemanticVersion -q | |
- name: Commit next version to main | |
run: | | |
VERSION=$(cat version.properties |grep "version="|cut -d= -f2) | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git stash | |
git pull | |
git stash pop | |
git add version.properties | |
git commit -m "increment version after release to ${VERSION} [skip ci]" | |
git push | |
#because using skip ci then we need this step to create a new release draft instead of running a build of main | |
prepare-release-draft: | |
needs: [ update-to-next-version ] | |
uses: ./.github/workflows/release-draft.yml | |
secrets: inherit |