-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github action to publish the gem (#307)
* Add Github action to publish the gem * Only publish on tags * Publish gems using direct commands, not third party action * Use rake build + gem push * Don't need github token
- Loading branch information
Showing
1 changed file
with
43 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,43 @@ | ||
name: Publish Gem | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set version | ||
id: version | ||
run: echo ::set-output name=version::${GITHUB_REF#refs/*/v} | ||
|
||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Ruby using Bundler | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.7.1" | ||
bundler-cache: true | ||
bundler: "2.1.4" | ||
|
||
- name: install gems | ||
run: bundle install | ||
|
||
- name: Setup Rubygems credentials | ||
run: | | ||
set +x | ||
mkdir -p ~/.gem | ||
cat << EOF > ~/.gem/credentials | ||
--- | ||
:rubygems_api_key: ${{secrets.OSC_RUBYGEMS_API_KEY}} | ||
EOF | ||
chmod 0600 ~/.gem/credentials | ||
- name: Publish Gem | ||
run: | | ||
rake build | ||
gem push pkg/ood_core-${{ steps.version.outputs.version }}.gem |