-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #11900: created Github action that does version bump and update…
… Milestone ID
- Loading branch information
1 parent
35ab9f1
commit 3d65e6c
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
VERSION=$1 | ||
echo VERSION="$VERSION" | ||
|
||
echo "bump version in pom.xml" | ||
mvn -e --no-transfer-progress versions:set -DnewVersion="$VERSION" | ||
mvn -e --no-transfer-progress versions:commit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -337,6 +337,7 @@ Djacoco | |
Dlinkcheck | ||
DMail | ||
Dmaven | ||
Dnew | ||
doccheck | ||
DOCKERHUB | ||
Dockter | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
source ./.ci/util.sh | ||
|
||
checkForVariable "READ_ONLY_TOKEN" | ||
|
||
VERSION=$1 | ||
|
||
echo "Updating milestone at github" | ||
MILESTONE_ID=$(curl -s \ | ||
-X GET https://api.github.com/repos/checkstyle/checkstyle/milestones?state=open \ | ||
| jq ".[0] | .number") | ||
|
||
echo VERSION="$VERSION" | ||
echo MILESTONE_ID="$MILESTONE_ID" | ||
|
||
curl \ | ||
-X PATCH https://api.github.com/repos/checkstyle/checkstyle/milestones/"$MILESTONE_ID" \ | ||
-H "Authorization: token $READ_ONLY_TOKEN" \ | ||
-d "{ \"title\": \"$VERSION\" }" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
############################################################################# | ||
# GitHub Action to bump release version | ||
# | ||
############################################################################# | ||
name: "Bump version and Update Milestone" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'New Version' | ||
required: true | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
printInputs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo "Latest Version: ${{ github.event.inputs.version }}" | ||
bump: | ||
name: Bump version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the latest code | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Modify File | ||
run: | | ||
./.ci/bump-version.sh ${{ github.event.inputs.version }} | ||
- name: Push commit | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git commit -am "minor: Bump release version to ${{ github.event.inputs.version }}" | ||
git push | ||
- name: GitHub Milestone | ||
run: | | ||
.ci/update-github-milestone.sh ${{ github.event.inputs.version }} | ||
env: | ||
READ_ONLY_TOKEN: ${{ github.token }} |