Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release.yml #10

Merged
merged 6 commits into from
Dec 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Bumpversion release version.
uses: tj-actions/bumpversion@v6.5
uses: tj-actions/bumpversion@v6.8
id: bumpversion
with:
commit: true
prefix: 'tj-actions/bumpversion@'
paths: |
README.md
- name: pull-request-${{ steps.bumpversion.outputs.new_branch_name }}
uses: repo-sync/pull-request@v2
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
source_branch: "${{ steps.bumpversion.outputs.new_branch_name }}"
destination_branch: "master"
pr_title: "Upgraded from ${{ steps.bumpversion.outputs.old_version }} -> ${{ steps.bumpversion.outputs.new_version }}"
pr_reviewer: "jackton1"
github_token: ${{ secrets.GITHUB_TOKEN }}
base: "master"
branch: "upgrade-to-${{ steps.bumpversion.outputs.new_version }}"
commit-message: "Upgraded from ${{ steps.bumpversion.outputs.old_version }} -> ${{ steps.bumpversion.outputs.new_version }}"
reviewers: "jackton1"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Update files that reference a project version with a new release number.
steps:
- uses: actions/checkout@v2
- name: Bumpversion release version.
uses: tj-actions/bumpversion@v6.6
uses: tj-actions/bumpversion@v6.7
id: bumpversion
with:
current_version: '1.0.1' # Omit to use git tag.
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Bumpversion release version.
uses: tj-actions/bumpversion@v6.6
uses: tj-actions/bumpversion@v6.7
id: bumpversion
with:
commit: true
Expand Down
5 changes: 0 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ inputs:
paths:
description: 'A list of file names to search and replace versions.'
required: true
commit:
description: 'Commit the version upgrade changes to a branch.'
required: false
default: false
prefix:
description: 'The prefix to match the location that needs to be updated'
required: false
Expand All @@ -33,7 +29,6 @@ runs:
- ${{ inputs.current_version }}
- ${{ inputs.new_version }}
- ${{ inputs.prefix }}
- ${{ inputs.commit }}
branding:
icon: arrow-up
color: green
23 changes: 0 additions & 23 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ FILES=$2
CURRENT_TAG=${3:-$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)")}
NEW_TAG=${4:-"${GITHUB_REF/refs\/tags\//}"}
PREFIX=$5
COMMIT=$6
NEW_BRANCH="upgrade-to-$NEW_TAG"

if [[ -z $CURRENT_TAG ]]; then
echo "Unable to determine where changes need to be updated."
Expand All @@ -28,26 +26,5 @@ do
sed -i "s|$PREFIX$CURRENT_TAG|$PREFIX$NEW_TAG|g" "$path"
done

git config user.name github-actions
git config user.email [email protected]


if [[ $(git status --porcelain) ]]; then
if [[ "$COMMIT" != "true" ]]; then
echo "::warning::Uncommited changes found"
git status
else
# Changes
echo "Committing changes..."
git checkout -B "$NEW_BRANCH"
git commit -am "Updraded from $CURRENT_TAG -> $NEW_TAG"
fi
else
echo "No changes made."
exit 0
fi


echo "::set-output name=new_version::$NEW_TAG"
echo "::set-output name=old_version::$CURRENT_TAG"
echo "::set-output name=new_branch_name::$NEW_BRANCH"