diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..5a338f53 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release to RubyGems + +"on": + push: + branches: + - release/* + +jobs: + pre-release-check: + uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main + + test: + uses: ./.github/workflows/test.yml + + publish-rubygem: + name: Publish Ruby Gem + needs: [pre-release-check, test] + runs-on: ubuntu-latest + environment: Release + steps: + - uses: actions/checkout@v4 + - uses: cucumber/action-publish-rubygem@v1.0.0 + with: + rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }} + + create-github-release: + name: Create GitHub Release and Git tag + needs: publish-rubygem + runs-on: ubuntu-latest + environment: Release + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: cucumber/action-create-github-release@v1.1.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ruby.yml b/.github/workflows/test.yml similarity index 97% rename from .github/workflows/ruby.yml rename to .github/workflows/test.yml index 0dc1b848..2d541833 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/test.yml @@ -6,12 +6,15 @@ name: CI "on": push: - branches: [main] + branches: + - main pull_request: - branches: [main] + branches: + - main + workflow_call: + workflow_dispatch: schedule: - cron: '16 4 12 * *' - workflow_dispatch: env: CUCUMBER_PUBLISH_QUIET: true