-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add release-please action for releasing to RubyGems (#14)
- Loading branch information
1 parent
3421f32
commit 3367a76
Showing
1 changed file
with
41 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,41 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v3 | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: ruby | ||
package-name: redaction | ||
bump-minor-pre-major: true | ||
version-file: "lib/redaction/version.rb" | ||
- uses: actions/checkout@v2 | ||
if: ${{ steps.release.outputs.release_created }} | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1.0 | ||
if: ${{ steps.release.outputs.release_created }} | ||
- run: | | ||
gem install bundler -v 2.3.3 | ||
bundle install | ||
bin/test | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: release gem | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
gem build *.gemspec | ||
gem push *.gem | ||
env: | ||
GEM_HOST_API_KEY: "${{secrets.GEM_HOST_API_KEY}}" | ||
if: ${{ steps.release.outputs.release_created }} |