Skip to content

Commit

Permalink
Simplify release workflow (#5144)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Jan 18, 2022
1 parent cee51bc commit 71685c1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 226 deletions.
195 changes: 0 additions & 195 deletions .github/workflows/patch-release-build.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# Releases a new minor / major version from a release branch
# Releases a new major / minor / patch version from a release branch
name: Release Build
on:
workflow_dispatch:
inputs:
release-branch-name:
description: The release branch to use, e.g. v1.9.x
required: true
version:
# TODO (trask) this is redundant
description: The version of the release, e.g. 1.9.0 (without the "v" prefix)
required: true

jobs:
test:
Expand All @@ -23,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v2.3.4
with:
ref: ${{ github.event.inputs.release-branch-name }}
ref: ${{ github.ref_name }}

- id: setup-test-java
name: Set up JDK ${{ matrix.test-java-version }} for running tests
Expand Down Expand Up @@ -74,7 +66,7 @@ jobs:

- uses: actions/checkout@v2.3.4
with:
ref: ${{ github.event.inputs.release-branch-name }}
ref: ${{ github.ref_name }}

- name: Set up JDK 11 for running Gradle
uses: actions/setup-java@v2
Expand All @@ -96,7 +88,7 @@ jobs:
steps:
- uses: actions/checkout@v2.3.4
with:
ref: ${{ github.event.inputs.release-branch-name }}
ref: ${{ github.ref_name }}

- name: Set up JDK 11 for running Gradle
uses: actions/setup-java@v2
Expand Down Expand Up @@ -142,7 +134,7 @@ jobs:
steps:
- uses: actions/checkout@v2.3.4
with:
ref: ${{ github.event.inputs.release-branch-name }}
ref: ${{ github.ref_name }}

- name: Set up JDK 11 for running Gradle
uses: actions/setup-java@v2
Expand Down Expand Up @@ -171,15 +163,21 @@ jobs:
arguments: build publishPlugins
build-root-directory: gradle-plugins

- name: Set release version
id: set-release-version
run: |
v=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts | head -1)
echo "::set-output name=release-version::$v"
- name: Create Release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
commitish: ${{ github.event.inputs.release-branch-name }}
release_name: Release v${{ github.event.inputs.version }}
tag_name: v${{ steps.set-release-version.outputs.release-version }}
commitish: ${{ github.ref_name }}
release_name: Release v${{ steps.set-release-version.outputs.release-version }}
draft: true
prerelease: false

Expand All @@ -190,6 +188,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: javaagent/build/libs/opentelemetry-javaagent-${{ github.event.inputs.version }}.jar
asset_path: javaagent/build/libs/opentelemetry-javaagent-${{ steps.set-release-version.outputs.release-version }}.jar
asset_name: opentelemetry-javaagent.jar
asset_content_type: application/java-archive
22 changes: 8 additions & 14 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ Before making the release:
* examples/extension/build.gradle
* Bump the version in the download link in the root `README.md` file

Open the release build workflow in your browser [here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/workflows/release-build.yml).
Open the [Release workflow](https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/workflows/release.yml).

You will see a button that says "Run workflow". Press the button, then enter the following:
* Use workflow from: <select the branch from dropdown list, e.g. `v1.9.x`>
* The release branch to use: <e.g. `v1.9.x`>
* The version of the release: <e.g. `1.9.0`>

(Yes there is redundancy between the above inputs that we plan to address.)
Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g. `v1.9.x`, and click the "Run workflow" button below that.

This triggers the release process, which builds the artifacts, publishes the artifacts, and creates
and pushes a git tag with the version number.
Expand Down Expand Up @@ -73,12 +69,10 @@ Before making the release:
* examples/distro/build.gradle
* examples/extension/build.gradle

To make a patch release, open the patch release build workflow in your browser
[here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/workflows/patch-release-build.yml).
Open the [Release workflow](https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/workflows/release.yml).

You will see a button that says "Run workflow". Press the button, then enter the following:
* Use workflow from: <select the branch from dropdown list, e.g. `v1.9.x`>
* The release branch to use: <e.g. `v1.9.x`>
* The version of the release: <e.g. `1.9.1`>
Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g. `v1.9.x`, and click the "Run workflow" button below that.

(Yes there is redundancy between the above inputs that we plan to address.)
This triggers the release process, which builds the artifacts, publishes the artifacts, and creates
and pushes a git tag with the version number.

0 comments on commit 71685c1

Please sign in to comment.