Deploy #117
Workflow file for this run
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: Deploy | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+.beta[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+.alpha[0-9]+' | |
jobs: | |
push_to_rubygems: | |
name: Push to RubyGems | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set RELEASE_TAG | |
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
bundler-cache: true | |
- name: Check Playwright::version | |
run: bundle exec ruby -e 'raise "invalid Playwright::VERSION" unless Playwright::VERSION == ENV["RELEASE_TAG"]' | |
- name: Generate API codes and build | |
run: | | |
bundle exec ruby development/generate_api.rb | |
rake build | |
- name: setup API key | |
run: | | |
mkdir -p ~/.gem/ | |
echo "---" > ~/.gem/credentials | |
echo ":rubygems_api_key: $RUBYGEMS_API_KEY" >> ~/.gem/credentials | |
chmod 600 ~/.gem/credentials | |
env: | |
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} | |
- run: gem push pkg/playwright-ruby-client-$RELEASE_TAG.gem |