chore: bump version to 0.4.2 #190
This file contains hidden or 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: latest | |
| # 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: | |
| name: pack (${{ matrix.os }}, ${{ matrix.platform }}, ${{ matrix.ruby }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Windows platforms | |
| - os: windows-latest | |
| platform: x64-mingw32 | |
| ruby: '3.4' | |
| - os: windows-latest | |
| platform: x64-mingw-ucrt | |
| ruby: '3.4' | |
| # Future: Windows ARM64 support (commented out due to OpenSSL build system incompatibility) | |
| # - os: windows-11-arm | |
| # platform: arm64-mingw-ucrt | |
| # ruby: '3.4' | |
| # macOS platforms | |
| - os: macos-latest | |
| platform: x86_64-darwin | |
| ruby: '3.4' | |
| - os: macos-latest | |
| platform: arm64-darwin | |
| ruby: '3.4' | |
| # Linux x86_64 platforms (gnu and musl) | |
| - os: ubuntu-latest | |
| platform: x86_64-linux | |
| ruby: '3.4' | |
| - os: ubuntu-latest | |
| platform: x86_64-linux-gnu | |
| ruby: '3.4' | |
| - os: ubuntu-latest | |
| platform: x86_64-linux-musl | |
| ruby: '3.4' | |
| # Linux aarch64 platforms (gnu and musl) | |
| - os: ubuntu-latest | |
| platform: aarch64-linux | |
| ruby: '3.4' | |
| - os: ubuntu-latest | |
| platform: aarch64-linux-gnu | |
| ruby: '3.4' | |
| - os: ubuntu-latest | |
| platform: aarch64-linux-musl | |
| ruby: '3.4' | |
| # Any platform (source gem) | |
| - os: ubuntu-latest | |
| platform: any | |
| ruby: '3.4' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler: ${{ env.BUNDLER_VER }} | |
| bundler-cache: true | |
| - if: matrix.platform == 'aarch64-linux' || matrix.platform == 'aarch64-linux-gnu' || matrix.platform == 'aarch64-linux-musl' | |
| 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 | |
| - if: matrix.platform == 'aarch64-linux-musl' | |
| name: Install musl cross-compiler for aarch64 | |
| run: | | |
| # Install musl-tools for musl builds | |
| sudo apt-get install musl-tools | |
| # For aarch64-musl, we'll use musl-gcc wrapper with aarch64-linux-gnu-gcc | |
| # This creates a musl-targeted build | |
| - run: bundle exec rake gem:native:${{ matrix.platform }} | |
| - uses: actions/upload-artifact@v6 | |
| if: failure() | |
| with: | |
| name: build-logs-${{ matrix.platform }} | |
| path: tmp/*/ports/*/*/*.log | |
| - if: matrix.platform != 'any' && !startsWith(matrix.platform, 'aarch64-') | |
| 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@v6 | |
| with: | |
| name: ${{ matrix.platform }}-pkg | |
| path: pkg/*.gem | |
| - if: matrix.platform != 'any' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: lib-${{ matrix.platform }} | |
| path: lib/ffi-libarchive-binary/libarchive.* | |
| test: | |
| needs: pack | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby: [ '3.1', '3.2', '3.3', '3.4' ] | |
| os: | |
| - windows-2022 | |
| - windows-2025 | |
| - macos-15 | |
| - macos-15-intel | |
| - macos-26 | |
| - ubuntu-24.04 | |
| - ubuntu-22.04 | |
| exclude: | |
| # Ruby 2.7 is not available on newer Ubuntu/macOS | |
| - os: ubuntu-24.04 | |
| ruby: '2.7' | |
| - os: macos-15 | |
| ruby: '2.7' | |
| - os: macos-15-intel | |
| ruby: '2.7' | |
| - os: macos-26 | |
| ruby: '2.7' | |
| include: | |
| # Windows platforms (x64-mingw32 for all Windows versions) | |
| - os: windows-2022 | |
| platform: x64-mingw32 | |
| - os: windows-2025 | |
| platform: x64-mingw32 | |
| # Windows ARM64 platform | |
| # - os: windows-11-arm | |
| # platform: arm64-mingw-ucrt | |
| # ruby: '3.4' | |
| # macOS platforms | |
| - os: macos-15 | |
| platform: arm64-darwin | |
| - os: macos-15-intel | |
| platform: x86_64-darwin | |
| - os: macos-26 | |
| platform: arm64-darwin | |
| # Ubuntu x86_64 platforms | |
| - os: ubuntu-24.04 | |
| platform: x86_64-linux | |
| - os: ubuntu-22.04 | |
| platform: x86_64-linux | |
| # Ubuntu ARM64 platforms | |
| - os: ubuntu-24.04-arm | |
| platform: aarch64-linux | |
| ruby: '3.4' | |
| - os: ubuntu-22.04-arm | |
| platform: aarch64-linux | |
| ruby: '3.4' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler: ${{ env.BUNDLER_VER }} | |
| bundler-cache: true | |
| - uses: actions/download-artifact@v7 | |
| 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.2', '3.3', '3.4' ] | |
| 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 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: metanorma/metanorma | |
| - uses: actions/download-artifact@v7 | |
| 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 ] | |
| runs-on: ubuntu-latest | |
| if: contains(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v7 | |
| 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 |