Sha256: e8ebb2844f25a29f4dd887db34f7178a418be0e9ee487a4e12e7ea5e0ca45930

Contents?: true

Size: 1.76 KB

Versions: 5

Compression:

Stored size: 1.76 KB

Contents

on: [push, pull_request]
jobs:
  # Run the test suite against multiple Ruby and Rails versions
  test_matrix:
    strategy:
      fail-fast: false
      matrix:
        # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
        ruby: [2.7, '3.0', 3.1]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
    - run: bundle exec rake

  # Branch protection rules cannot directly depend on status checks from matrix jobs.
  # So instead we define `test` as a dummy job which only runs after the preceding `test_matrix` checks have passed.
  # Solution inspired by: https://github.community/t/status-check-for-a-matrix-jobs/127354/3
  test:
    needs: test_matrix
    runs-on: ubuntu-latest
    steps:
      - run: echo "All matrix tests have passed 🚀"

  release:
    needs: test
    runs-on: ubuntu-latest
    if: ${{ github.ref == 'refs/heads/main' }}
    permissions:
      contents: write
    steps:
    - uses: actions/checkout@v3
    - uses: ruby/setup-ruby@v1
      with:
        rubygems: latest
    - env:
        GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
        GEM_NAME: govuk_app_config
      run: |
        VERSION=$(ruby -e "puts eval(File.read('$GEM_NAME.gemspec')).version")
        GEM_VERSION=$(gem list --exact --remote $GEM_NAME)

        # Publish to RubyGems.org
        if [ "${GEM_VERSION}" != "$GEM_NAME (${VERSION})" ]; then
          gem build $GEM_NAME.gemspec
          gem push "$GEM_NAME-${VERSION}.gem"
        fi

        # Create a release tag
        if ! git ls-remote --tags --exit-code origin v${VERSION}; then
          git tag v${VERSION}
          git push --tags
        fi

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
govuk_app_config-4.6.3 .github/workflows/ci.yml
govuk_app_config-4.6.2 .github/workflows/ci.yml
govuk_app_config-4.6.1 .github/workflows/ci.yml
govuk_app_config-4.6.0 .github/workflows/ci.yml
govuk_app_config-4.5.0 .github/workflows/ci.yml