Release #75
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: Release | |
on: | |
workflow_dispatch: | |
jobs: | |
# assemble: | |
# uses: ./.github/workflows/reusable-assemble.yml | |
# test-java8: | |
# uses: ./.github/workflows/reusable-test-8.yml | |
# | |
# test-java11: | |
# uses: ./.github/workflows/reusable-test-11.yml | |
# test-latest-deps is intentionally not included in the release workflows | |
# because any time a new library version is released to maven central | |
# it can fail due to test code incompatibility with the new library version, | |
# or due to slight changes in emitted telemetry | |
# smoke-test: | |
# uses: ./.github/workflows/reusable-smoke-test.yml | |
# muzzle is intentionally not included in the release workflows | |
# because any time a new library version is released to maven central it can fail, | |
# and this is not a reason to hold up the release | |
# gradle-plugins: | |
# uses: ./.github/workflows/reusable-gradle-plugins.yml | |
# removed this for now until we decide what to do with the extenstions | |
# examples: | |
# uses: ./.github/workflows/reusable-examples.yml | |
release: | |
needs: [] | |
# - assemble | |
# - test-java8 | |
# - test-java11 | |
# - smoke-test | |
# - gradle-plugins | |
# - examples | |
outputs: | |
version: ${{ steps.create-github-release.outputs.version }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set environment variables | |
run: | | |
version=$(.github/scripts/get-version.sh) | |
if [[ $version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then | |
major="${BASH_REMATCH[1]}" | |
minor="${BASH_REMATCH[2]}" | |
patch="${BASH_REMATCH[3]}" | |
else | |
echo "unexpected version: $version" | |
exit 1 | |
fi | |
if [[ $patch == 0 ]]; then | |
if [[ $minor == 0 ]]; then | |
prior_major=$((major - 1)) | |
prior_minor=$(grep -Po "^## Version $prior_major.\K[0-9]+" CHANGELOG.md | head -1) | |
prior_version="$prior_major.$prior_minor" | |
else | |
prior_version="$major.$((minor - 1)).0" | |
fi | |
else | |
prior_version="$major.$minor.$((patch - 1))" | |
fi | |
echo "VERSION=$version" >> $GITHUB_ENV | |
echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV | |
# check out main branch to verify there won't be problems with merging the change log | |
# at the end of this workflow | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
# back to the release branch | |
- uses: actions/checkout@v3 | |
with: | |
# tags are needed for the generate-release-contributors.sh script | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Execute Gradle build | |
run: ./gradlew build -x :instrumentation:aws-sdk:aws-sdk-1.11:javaagent:test -x :instrumentation:vaadin-14.2:javaagent:vaadin142Test -x :instrumentation:vaadin-14.2:javaagent:vaadin16Test | |
- id: create-github-release | |
name: Create GitHub release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cp javaagent/build/libs/opentelemetry-javaagent-${VERSION}.jar opentelemetry-javaagent.jar | |
gh release create --target $GITHUB_REF_NAME \ | |
--title "Version $VERSION" \ | |
v$VERSION \ | |
opentelemetry-javaagent.jar | |
echo "::set-output name=version::$VERSION" |