Release 5.2.0 #12
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: Release | |
on: | |
push: | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v2.1.3 | |
jobs: | |
build_ruby: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.7' | |
- name: Configure Nokogiri installation (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
bundle config --local build__nokogiri --use-system-libraries | |
sudo apt-get install libxslt1-dev | |
- name: Install dependencies | |
run: bundle --jobs 3 --retry 3 | |
- name: Build | |
run: bundle exec rake build | |
- name: Run tests | |
run: bundle exec rake test | |
- name: Run examples:convert | |
run: bundle exec rake examples:convert | |
publish_ruby: | |
needs: build_ruby | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.7' | |
- name: Install and build | |
run: | | |
bundle --jobs 3 --retry 3 | |
bundle exec rake build | |
- name: Configure credentials | |
run: | | |
mkdir -p $HOME/.gem | |
touch $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > $HOME/.gem/credentials | |
env: | |
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
- name: Build gem | |
run: | | |
gem build asciidoctor-revealjs.gemspec | |
# can't use "${GITHUB_REF#refs/tags/v}" because the actual RubyGem version can be slightly different on prerelease | |
# see: https://guides.rubygems.org/patterns/#prerelease-gems | |
- name: Publish to rubygems.org | |
run: | | |
gem push asciidoctor-revealjs-*.gem | |
publish_js: | |
needs: publish_ruby | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org/ | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.7' | |
- name: Install and build | |
run: | | |
bundle --jobs 3 --retry 3 | |
bundle exec rake build | |
bundle exec rake build:js | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Test | |
run: | | |
npm t | |
- name: Package and publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
npm publish | |
npm run package | |
npm run release:description ${GITHUB_REF#refs/tags/v} | |
# create the GitHub release | |
- name: Create release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body_path: dist/changelog.md | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
# upload binaries | |
- name: Upload Linux binary | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/reveal-linux | |
asset_name: asciidoctor-revealjs-linux | |
asset_content_type: application/octet-stream | |
- name: Upload macOS binary | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/reveal-macos | |
asset_name: asciidoctor-revealjs-macos | |
asset_content_type: application/octet-stream | |
- name: Upload Windows binary | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/reveal-win.exe | |
asset_name: asciidoctor-revealjs-win.exe | |
asset_content_type: application/octet-stream | |