Merge pull request #22 from dysonreturns/base-building-updates #48
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-please | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
pages: write | |
id-token: write | |
packages: write | |
jobs: | |
build: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
name: Build ${{ matrix.ruby }} | |
strategy: | |
matrix: | |
ruby: | |
- '3.3.0' | |
steps: | |
- name: Update Release PR | |
uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: "ruby" | |
changelog-path: "docs/CHANGELOG.md" | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Install OS dependencies | |
run: sudo apt-get install -y libopenblas0 | |
- name: Bundle install | |
run: bundle install | |
- name: Run the default task | |
run: bundle exec rake | |
- name: Publish to GPR | |
run: | | |
mkdir -p $HOME/.gem | |
touch $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | |
gem build *.gemspec | |
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem | |
env: | |
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}" | |
OWNER: ${{ github.repository_owner }} | |
if: steps.release.outputs.release_created | |
- name: Publish to RubyGems | |
run: | | |
mkdir -p $HOME/.gem | |
touch $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | |
gem build *.gemspec | |
gem push *.gem | |
env: | |
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" | |
if: steps.release.outputs.release_created | |
- name: Generate documentation | |
run: bundle exec yard doc | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './doc' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |