publish_sdk #65
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
name: Publish | |
on: | |
push: | |
branches: [ master ] | |
repository_dispatch: | |
types: [publish_sdk] | |
workflow_dispatch: | |
jobs: | |
Publish: | |
name: Release to RubyGems | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.6 | |
- run: bundle install | |
- name: Publish to RubyGems | |
run: | | |
mkdir -p $HOME/.gem | |
touch $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
printf -- "---\n:rubygems_api_key: ${RUBY_GEMS_API_KEY}\n" > $HOME/.gem/credentials | |
gem build *.gemspec | |
gem push *.gem | |
env: | |
RUBY_GEMS_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" | |
- name: Slack notification | |
uses: ravsamhq/notify-slack-action@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
notification_title: "{repo}: {workflow} workflow" | |
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" | |
footer: "<{workflow_url}|View Workflow>" | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |