-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create workflow for publishing gem (#2)
* Create workflow for publishing gem * Update Gemfile.lock
- Loading branch information
Showing
3 changed files
with
43 additions
and
6 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,37 @@ | ||
name: Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_publish: | ||
name: Build and Publish | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6 | ||
- name: Build gem | ||
run: gem build *.gemspec | ||
- name: Publish to GitHub Package Registry | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials | ||
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
OWNER: microsoft | ||
- name: Publish to RubyGems | ||
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 push *.gem | ||
env: | ||
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}} |
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
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