Skip to content

Workflow file for this run

on:
release:
types: [published]
name: Publish primer_view_components and @primer/view-components
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- name: Create .gem credentials
run: |
mkdir -p $HOME/.gem
cat << EOF > $HOME/.gem/credentials
---
:rubygems_api_key: ${RUBYGEMS_TOKEN}
EOF
chmod 0600 $HOME/.gem/credentials
env:
RUBYGEMS_TOKEN: ${{ secrets.RUBYGEMS_TOKEN_SHARED }}
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Create .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
- name: NPM install
run: |
npm ci
- name: Publish Gem
run: bundle exec rake release
- name: Publish NPM
run: npm publish --access public