Skip to content

Commit a547e2a

Browse files
authored
Sync'ing workflow changes/fixes (open-telemetry#4388)
* Sync * Fix prepare release workflow * Better links * Fix links * Fix links * Fix * format * Sync release branch name * Add comment * more
1 parent e628013 commit a547e2a

9 files changed

Lines changed: 69 additions & 52 deletions

.github/scripts/markdown-link-check-config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"aliveStatusCodes": [
44
200,
55
403
6+
],
7+
"ignorePatterns": [
8+
{
9+
"pattern": "^https://github.com/open-telemetry/TODO/"
10+
}
611
]
712
}

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ jobs:
7171

7272
markdown-link-check:
7373
# release branches are excluded to avoid unnecessary maintenance if external links break
74-
if: ${{ !startsWith(github.ref_name, 'v') }}
74+
if: ${{ !startsWith(github.ref_name, 'release/') }}
7575
uses: ./.github/workflows/reusable-markdown-link-check.yml
7676

7777
misspell-check:
7878
# release branches are excluded to avoid unnecessary maintenance if new misspellings are added
7979
# to the misspell dictionary
80-
if: ${{ !startsWith(github.ref_name, 'v') }}
80+
if: ${{ !startsWith(github.ref_name, 'release/') }}
8181
uses: ./.github/workflows/reusable-misspell-check.yml
8282

8383
publish-snapshots:

.github/workflows/codeql-daily.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Perform CodeQL analysis
3232
uses: github/codeql-action/analyze@v1
3333

34-
issue:
34+
open-issue-on-failure:
3535
needs: analyze
3636
if: failure()
3737
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: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Set versions
2727
id: set-versions
2828
run: |
29-
version=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts | head -1)
29+
version=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts)
3030
if [[ $version =~ ([0-9]+).([0-9]+).([0-9]+) ]]; then
3131
major="${BASH_REMATCH[1]}"
3232
minor="${BASH_REMATCH[2]}"
@@ -38,13 +38,13 @@ jobs:
3838
if [[ $patch == 0 ]]; then
3939
if [[ $minor == 0 ]]; then
4040
prior_major=$((major - 1))
41-
prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
41+
prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
4242
prior_version="$prior_major.$prior_minor"
4343
else
4444
prior_version="$major.$((minor - 1)).0"
4545
fi
4646
else
47-
prior_version="$major.$minor.$((patch - 1))"
47+
prior_version="$major.$minor.$((patch - 1))"
4848
fi
4949
echo "VERSION=$version" >> $GITHUB_ENV
5050
echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV
@@ -98,6 +98,8 @@ jobs:
9898
v$VERSION
9999
100100
- name: Update the change log with the release date
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101103
run: |
102104
date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
103105
sed -ri "s/## Version $VERSION .*/## Version $VERSION ($date)/" CHANGELOG.md

RELEASING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ to view a summary of all commits since last release as a reference.
1414
* Close the release milestone if there is one.
1515
* Merge a pull request to `main` updating the `CHANGELOG.md`.
1616
* The heading for the release should include the release version but not the release date, e.g.
17-
`## Version 1.9.0 (unreleased)`.
18-
* Run the [Prepare release branch workflow](.github/workflows/prepare-release-branch.yml).
17+
`## Version 1.9.0 (unreleased)`.
18+
* Run the [Prepare release branch workflow](https://github.com/open-telemetry/opentelemetry-java/actions/workflows/prepare-release-branch.yml).
1919
* Review and merge the two pull requests that it creates
2020
(one is targeted to the release branch and one is targeted to the `main` branch).
2121

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

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

4242
## Making the release
4343

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

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

5353
## After the release
5454

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

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

0 commit comments

Comments
 (0)