-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5af94e
commit 2d27c9c
Showing
1 changed file
with
23 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ permissions: | |
pull-requests: read # to detect changes files | ||
|
||
jobs: | ||
publish-gem: | ||
release: | ||
name: Publish Ruby Gem | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -24,6 +24,28 @@ jobs: | |
- name: Install dependencies | ||
run: bundle install | ||
|
||
- name: Bump version | ||
run: | | ||
NEW_VERSION=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//') # strip the 'v' from the tag if present | ||
sed -i -r "s/VERSION = \".+\"/^VERSION = \"${NEW_VERSION}\"/" ./lib/descope/version.rb | ||
- name: Commit changes | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
git commit -am "Bump version to $NEW_VERSION" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Repoint the tag to latest commit | ||
run: | | ||
git tag -fa ${{ github.event.release.tag_name }} -m "Release $NEW_VERSION" | ||
git push origin :${{ github.event.release.tag_name }} | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to RubyGems | ||
run: | | ||
mkdir -p $HOME/.gem | ||
|