chore: rc 1 #119
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: test-and-release | |
on: | |
push: | |
branches: [ main ] | |
tags: [ 'v*' ] | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' | |
cancel-in-progress: true | |
env: | |
BUNDLER_VER: 2.3.24 | |
# Forcing bundler version to ensure that it is consistent everywhere and | |
# does not cause bundler gem reinstalls | |
# bundler/rubygems 2.3.22 is a minimal requirement to support gnu/musl differentiation | |
# https://github.com/rubygems/rubygems/pull/4488 | |
jobs: | |
pack: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
platform: x64-mingw32 | |
ruby: '2.7' | |
- os: windows-latest | |
platform: x64-mingw-ucrt | |
ruby: '3.1' | |
- os: macos-latest | |
platform: x86_64-darwin | |
ruby: '2.7' | |
- os: macos-latest | |
platform: arm64-darwin | |
ruby: '2.7' | |
- os: ubuntu-latest | |
platform: x86_64-linux | |
ruby: '2.7' | |
- os: ubuntu-latest | |
platform: aarch64-linux | |
ruby: '2.7' | |
- os: ubuntu-latest | |
platform: any | |
ruby: '2.7' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler: ${{ env.BUNDLER_VER }} | |
bundler-cache: true | |
- if: matrix.platform == 'aarch64-linux' | |
name: Install aarch64 compilers | |
run: | | |
sudo apt-get update | |
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf | |
echo "CMAKE_TOOLCHAIN_FILE=$(pwd)/toolchain/aarch64-linux-gnu.cmake" >> $GITHUB_ENV | |
- run: bundle exec rake gem:native:${{ matrix.platform }} | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: build-logs-${{ matrix.platform }} | |
path: tmp/*/ports/*/*/*.log | |
- if: matrix.platform != 'any' && matrix.platform != 'aarch64-linux' | |
uses: metanorma/metanorma-build-scripts/native-deps-action@main | |
with: | |
libname: archive | |
directory: lib/ffi-libarchive-binary | |
- run: | | |
cd pkg/ | |
gem unpack ffi-libarchive-binary-*.gem | |
ls */lib/ffi-libarchive-binary | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.platform }}-pkg | |
path: pkg/*.gem | |
- if: matrix.platform != 'any' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lib-${{ matrix.platform }} | |
path: lib/ffi-libarchive-binary/libarchive.* | |
test: | |
needs: pack | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3' ] | |
os: [ windows-latest, macos-latest, ubuntu-latest ] | |
include: | |
- os: windows-latest | |
platform: x64-mingw32 | |
- os: macos-latest | |
platform: x86_64-darwin | |
- os: ubuntu-latest | |
platform: x86_64-linux | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler: ${{ env.BUNDLER_VER }} | |
bundler-cache: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: lib-${{ matrix.platform }} | |
path: lib/ffi-libarchive-binary | |
- run: bundle exec rspec | |
metanorma: | |
needs: pack | |
runs-on: ${{ matrix.env.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: [ '3.1', '3.2', '3.3' ] | |
env: [ { os: macos-latest, platform: arm64-darwin }, { os: ubuntu-latest, platform: x86_64-linux } ] | |
experimental: [true] | |
include: | |
- env: { os: windows-latest, platform: x64-mingw-ucrt } | |
ruby: '3.3' | |
experimental: true | |
- env: { os: windows-latest, platform: x64-mingw-ucrt } | |
ruby: '3.1' | |
experimental: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: metanorma/metanorma | |
- uses: actions/download-artifact@v4 | |
with: | |
path: pkg | |
pattern: '*-pkg' | |
merge-multiple: true | |
- name: Setup ffi-libarchive-binary | |
run: | | |
gem unpack --target pkg pkg/ffi-libarchive-binary-*-${{ matrix.env.platform }}.gem | |
mv pkg/ffi-libarchive-binary-*-${{ matrix.env.platform }} pkg/ffi-libarchive-binary | |
echo "gem 'ffi-libarchive-binary', path: 'pkg/ffi-libarchive-binary'" > Gemfile.devel | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler: ${{ env.BUNDLER_VER }} | |
bundler-cache: true | |
- uses: metanorma/metanorma-build-scripts/inkscape-setup-action@main | |
- run: bundle exec rake | |
continue-on-error: ${{ matrix.experimental }} | |
# ----- Release ----- | |
release: | |
name: Release gem | |
needs: [ pack, test, metanorma ] | |
runs-on: ubuntu-latest | |
if: contains(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: pkg | |
pattern: '*-pkg' | |
merge-multiple: true | |
- name: Publish to rubygems.org | |
env: | |
RUBYGEMS_API_KEY: ${{secrets.FONTIST_CI_RUBYGEMS_API_KEY}} | |
run: | | |
mkdir -p ~/.gem | |
touch ~/.gem/credentials | |
cat > ~/.gem/credentials << EOF | |
--- | |
:rubygems_api_key: ${RUBYGEMS_API_KEY} | |
EOF | |
chmod 0600 ~/.gem/credentials | |
gem signin | |
mkdir tmp | |
for gem in pkg/*.gem; do gem push -V $gem; done | |
# for gem in pkg/*.gem; do echo "Will do: 'gem push -V $gem'"; done |