From 7d2b6957527414a0290627f874822169c0342fac Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Sun, 26 Jul 2026 23:29:52 +0800 Subject: [PATCH] Adopt metanorma/ci reusable workflows from elkrb Replace bespoke test.yml + release.yml with the standard claricle/metanorma CI pattern: - rake.yml: uses metanorma/ci generic-rake.yml (runs rspec + rubocop) - release.yml: uses metanorma/ci rubygems-release.yml (manual dispatch) --- .github/workflows/rake.yml | 15 +++++++++ .github/workflows/release.yml | 57 +++++++++++++---------------------- .github/workflows/test.yml | 32 -------------------- 3 files changed, 36 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/rake.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/rake.yml b/.github/workflows/rake.yml new file mode 100644 index 0000000..2f6c22e --- /dev/null +++ b/.github/workflows/rake.yml @@ -0,0 +1,15 @@ +name: rake + +permissions: + contents: read + +on: + push: + branches: [ master, main ] + tags: [ v* ] + pull_request: + workflow_dispatch: + +jobs: + rake: + uses: metanorma/ci/.github/workflows/generic-rake.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 230fc90..7bfcb47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,42 +1,27 @@ -name: Release - -on: - push: - tags: - - "v*" +# Auto-generated by Cimas: Do not edit it manually! +# See https://github.com/metanorma/cimas +name: release permissions: contents: write + packages: write + +on: + workflow_dispatch: + inputs: + next_version: + description: | + Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc + required: true + default: "skip" + repository_dispatch: + types: [do-release] jobs: release: - name: Build and publish - runs-on: ubuntu-latest - environment: release - - steps: - - uses: actions/checkout@v4 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.3" - bundler-cache: true - - - name: Build gem - run: bundle exec rake build - - - name: Publish to rubygems.org - env: - EMFSVG_RUBYGEMS_API_KEY: ${{ secrets.EMFSVG_RUBYGEMS_API_KEY }} - run: | - mkdir -p ~/.gem - printf '---\n:rubygems_api_key: %s\n' "$EMFSVG_RUBYGEMS_API_KEY" > ~/.gem/credentials - chmod 0600 ~/.gem/credentials - gem push pkg/emfsvg-*.gem - - - name: Create GitHub release - uses: softprops/action-gh-release@v2 - with: - generate_release_notes: true - files: pkg/emfsvg-*.gem + uses: metanorma/ci/.github/workflows/rubygems-release.yml@main + with: + next_version: ${{ github.event.inputs.next_version }} + secrets: + rubygems-api-key: ${{ secrets.CLARICLE_CI_RUBYGEMS_API_KEY }} + pat_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 91fd162..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Test - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - test: - name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - ruby: ["3.1", "3.2", "3.3", "3.4"] - os: [ubuntu-latest, macos-latest] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Ruby ${{ matrix.ruby }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - - name: Run specs - run: bundle exec rspec - - - name: Run rubocop - run: bundle exec rubocop