Release gem #9
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: Release gem | |
on: | |
workflow_dispatch: | |
inputs: | |
rubygems-otp-code: | |
description: RubyGems OTP code | |
required: true | |
type: string | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: | |
- 20 | |
ruby-version: | |
- 3.3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler: latest | |
bundler-cache: true | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: npm | |
cache-dependency-path: frontend/package-lock.json | |
# Build YAML format Swagger doc | |
- name: Build Swagger doc | |
run: bundle exec rake build:swagger | |
# Build ReDoc docs & buld the frontend assets | |
- name: Buld frontend | |
run: | | |
npm install | |
npm run docs | |
npm run build-only | |
working-directory: frontend | |
# Copy the frontend assets into lib | |
- name: Copy forntend assets | |
run: | | |
mkdir -p lib/mihari/web/public/ | |
cp -r frontend/dist/* lib/mihari/web/public | |
- name: Configure Git | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Release gem | |
run: bundle exec rake release | |
env: | |
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} | |
GEM_HOST_OTP_CODE: ${{ inputs.rubygems-otp-code }} |