Skip to content

Commit ba3ab59

Browse files
authored
Sync'ing workflow changes/fixes (#298)
* Sync * Fix prepare release workflow * Better links * more * format * format
1 parent 45cf9b0 commit ba3ab59

File tree

6 files changed

+23
-24
lines changed

6 files changed

+23
-24
lines changed

.github/workflows/codeql-daily.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Perform CodeQL analysis
3535
uses: github/codeql-action/analyze@v1
3636

37-
issue:
37+
open-issue-on-failure:
3838
needs: analyze
3939
if: failure()
4040
uses: ./.github/workflows/reusable-create-issue-for-failure.yml

.github/workflows/merge-change-log-to-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44

55
jobs:
66
create-pull-request:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v3
1010
with:

.github/workflows/prepare-patch-release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
- name: Set environment variables
1212
run: |
13-
prior_version=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts | head -1)
13+
prior_version=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts)
1414
if [[ $prior_version =~ ([0-9]+.[0-9]+).([0-9]+) ]]; then
1515
major_minor="${BASH_REMATCH[1]}"
1616
patch="${BASH_REMATCH[2]}"
@@ -19,11 +19,10 @@ jobs:
1919
exit 1
2020
fi
2121
echo "VERSION=$major_minor.$((patch + 1))" >> $GITHUB_ENV
22-
echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV
2322
24-
- name: Bump version
23+
- name: Update version
2524
run: |
26-
sed -ri "s/$PRIOR_VERSION/$VERSION/" version.gradle.kts
25+
sed -ri "s/[0-9]+\.[0-9]+\.[0-9]+/$VERSION/" version.gradle.kts
2726
2827
- name: Set git user
2928
run: |

.github/workflows/prepare-release-branch.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
- name: Create release branch
1212
id: create-release-branch
1313
run: |
14-
version=$(grep -Eo "[0-9]+.[0-9]+.0-SNAPSHOT" version.gradle.kts | sed 's/-SNAPSHOT//')
14+
version=$(grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts)
1515
release_branch_name=$(echo $version | sed -E 's,([0-9]+)\.([0-9]+)\.0,release/v\1.\2.x,')
1616
1717
git push origin HEAD:$release_branch_name
1818
1919
echo "VERSION=$version" >> $GITHUB_ENV
2020
echo "RELEASE_BRANCH_NAME=$release_branch_name" >> $GITHUB_ENV
2121
22-
- name: Drop snapshot from version
22+
- name: Update version
2323
run: |
2424
sed -ri "s/val snapshot = true/val snapshot = false/" version.gradle.kts
2525
@@ -45,9 +45,9 @@ jobs:
4545
steps:
4646
- uses: actions/checkout@v3
4747

48-
- name: Bump snapshot version
48+
- name: Update version
4949
run: |
50-
version=$(grep -Eo "[0-9]+.[0-9]+.0-SNAPSHOT" version.gradle.kts | sed 's/-SNAPSHOT//')
50+
version=$(grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts)
5151
if [[ $version =~ ([0-9]+).([0-9]+).0 ]]; then
5252
major="${BASH_REMATCH[1]}"
5353
minor="${BASH_REMATCH[2]}"
@@ -56,7 +56,7 @@ jobs:
5656
exit 1
5757
fi
5858
next_version="$major.$((minor + 1)).0"
59-
sed -ri "s/$version-SNAPSHOT/$next_version-SNAPSHOT/" version.gradle.kts
59+
sed -ri "s/[0-9]+\.[0-9]+\.[0-9]+/$next_version/" version.gradle.kts
6060
6161
- name: Set git user
6262
run: |
@@ -67,10 +67,10 @@ jobs:
6767
env:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6969
run: |
70-
msg="Bump version"
70+
msg="Update version"
7171
git commit -a -m "$msg"
72-
git push origin HEAD:bump-snapshot-version
72+
git push origin HEAD:update-version-on-main
7373
gh pr create --title "$msg" \
7474
--body "$msg" \
75-
--head bump-snapshot-version \
75+
--head update-version-on-main \
7676
--base main

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Set environment variables
8080
run: |
81-
version=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts | head -1)
81+
version=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts)
8282
if [[ $version =~ ([0-9]+).([0-9]+).([0-9]+) ]]; then
8383
major="${BASH_REMATCH[1]}"
8484
minor="${BASH_REMATCH[2]}"
@@ -90,13 +90,13 @@ jobs:
9090
if [[ $patch == 0 ]]; then
9191
if [[ $minor == 0 ]]; then
9292
prior_major=$((major - 1))
93-
prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
93+
prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
9494
prior_version="$prior_major.$prior_minor"
9595
else
9696
prior_version="$major.$((minor - 1)).0"
9797
fi
9898
else
99-
prior_version="$major.$minor.$((patch - 1))"
99+
prior_version="$major.$minor.$((patch - 1))"
100100
fi
101101
echo "VERSION=$version" >> $GITHUB_ENV
102102
echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV

RELEASING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ as the last step, which publishes a snapshot build to
1515
* Close the release milestone if there is one.
1616
* Merge a pull request to `main` updating the `CHANGELOG.md`.
1717
* The heading for the release should include the release version but not the release date, e.g.
18-
`## Version 1.9.0 (unreleased)`.
18+
`## Version 1.9.0 (unreleased)`.
1919
* Use `.github/scripts/draft-change-log-entries.sh` as a starting point for writing the change
2020
log.
21-
* Run the [Prepare release branch workflow](.github/workflows/prepare-release-branch.yml).
21+
* Run the [Prepare release branch workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/prepare-release-branch.yml).
2222
* Review and merge the two pull requests that it creates
2323
(one is targeted to the release branch and one is targeted to the `main` branch).
2424

@@ -29,22 +29,22 @@ All patch releases should include only bug-fixes, and must avoid adding/modifyin
2929
In general, patch releases are only made for regressions, memory leaks and deadlocks.
3030

3131
* Backport pull request(s) to the release branch.
32-
* Run the [Backport workflow](.github/workflows/backport.yml).
32+
* Run the [Backport workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/backport.yml).
3333
* Press the "Run workflow" button, then select the release branch from the dropdown list,
3434
e.g. `release/v1.9.x`, then enter the pull request number that you want to backport,
3535
then click the "Run workflow" button below that.
3636
* Review and merge the backport pull request that it generates.
3737
* Merge a pull request to the release branch updating the `CHANGELOG.md`.
3838
* The heading for the release should include the release version but not the release date, e.g.
39-
`## Version 1.9.0 (unreleased)`.
40-
* Run the [Prepare patch release workflow](.github/workflows/prepare-patch-release.yml).
39+
`## Version 1.9.0 (unreleased)`.
40+
* Run the [Prepare patch release workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/prepare-patch-release.yml).
4141
* Press the "Run workflow" button, then select the release branch from the dropdown list,
4242
e.g. `release/v1.9.x`, and click the "Run workflow" button below that.
4343
* Review and merge the pull request that it creates.
4444

4545
## Making the release
4646

47-
Run the [Release workflow](.github/workflows/release.yml).
47+
Run the [Release workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/release.yml).
4848

4949
* Press the "Run workflow" button, then select the release branch from the dropdown list,
5050
e.g. `release/v1.9.x`, and click the "Run workflow" button below that.
@@ -55,7 +55,7 @@ Run the [Release workflow](.github/workflows/release.yml).
5555

5656
## After the release
5757

58-
Run the [Merge change log to main workflow](.github/workflows/merge-change-log-to-main.yml).
58+
Run the [Merge change log to main workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/merge-change-log-to-main.yml).
5959

6060
* Press the "Run workflow" button, then select the release branch from the dropdown list,
6161
e.g. `release/v1.9.x`, and click the "Run workflow" button below that.

0 commit comments

Comments
 (0)