Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rcvalle committed Nov 16, 2024
1 parent dabdb2d commit 48921d5
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
fi
fi
version=$(grep -E "Version = \[([0-9]+), ([0-9]+), ([0-9]+)\]" *.gemspec)
major=$(echo "$version" | grep -Eo '\[[0-9]+' | tr -d '[')
minor=$(echo "$version" | grep -Eo ', [0-9]+,' | tr -d ', ')
patch=$(echo "$version" | grep -Eo ', [0-9]+\]' | tr -d ', ]')
version=$(grep -E "Version = \[[0-9]+, [0-9]+, [0-9]+\]" *.gemspec | grep -Eo '\[[0-9]+, [0-9]+, [0-9]+\]' | tr -d '[]')
major=$(echo "$version" | cut -d, -f1 | tr -d ' ')
minor=$(echo "$version" | cut -d, -f2 | tr -d ' ')
patch=$(echo "$version" | cut -d, -f3 | tr -d ' ')
case $version_increment in
major)
Expand All @@ -76,8 +76,8 @@ jobs:
;;
esac
new_version="Version = [$new_major, $new_minor, $new_patch]"
sed -i "s/^Version = \[.*\]/${new_version}/" *.gemspec
new_version="${new_major}, ${new_minor}, ${new_patch}"
sed -i -E "s/(Version = \[)[0-9]+, [0-9]+, [0-9]+/\1${new_version}/" *.gemspec
echo "version=$major.$minor.$patch" >> $GITHUB_ENV
echo "new_version=$new_major.$new_minor.$new_patch" >> $GITHUB_ENV
Expand All @@ -102,6 +102,11 @@ jobs:
gh release create "v${{ env.new_version }}" -F "$changelog" -t "v${{ env.new_version }}"
rm "$changelog"
- name: Build
run: |
bundle install
gem build *.gemspec
- name: Publish to GitHub Packages
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
Expand Down

0 comments on commit 48921d5

Please sign in to comment.