diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..0b8ff19 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,26 @@ +name: CD + +on: + push: + branches: + - "main" +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445 + - name: Tag and Push Gem + id: tag-and-push-gem + uses: discourse/publish-rubygems-action@2d713f2092b4f02da811f4b591a10b6b56f0780e + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + GIT_EMAIL: ${{secrets.ALEX_GIT_EMAIL}} + GIT_NAME: ${{secrets.ALEX_GIT_NAME}} + RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} + - name: Create GitHub Release + uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477 + if: ${{ steps.tag-and-push-gem.outputs.new_version == 'true' }} + with: + tag_name: v${{steps.tag-and-push-gem.outputs.gem_version}} + generate_release_notes: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0132dfb..dbfba11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name: CI -on: [push, pull_request] +on: [push] jobs: - build: + rspec: runs-on: ubuntu-latest strategy: matrix: @@ -16,28 +16,25 @@ jobs: - head env: BUNDLE_GEMFILE: Gemfile - name: "Tests: Ruby ${{ matrix.ruby }}" + name: "RSpec tests: Ruby ${{ matrix.ruby }}" steps: - - uses: actions/checkout@5126516654c75f76bca1de45dd82a3006d8890f9 + - uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445 - name: Set up Ruby ${{ matrix.ruby }} - uses: ruby/setup-ruby@bd94d6a504586da892a5753afdd1480096ed30df + uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 with: + bundler-cache: true ruby-version: ${{ matrix.ruby }} - name: Run tests - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - bundle exec rspec - static-type-checking: + run: bundle exec rspec + static_type_check: + name: "Type Check" runs-on: ubuntu-latest steps: - - uses: actions/checkout@5126516654c75f76bca1de45dd82a3006d8890f9 + - uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445 - name: Set up Ruby - uses: ruby/setup-ruby@bd94d6a504586da892a5753afdd1480096ed30df + uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 with: + bundler-cache: true ruby-version: head - name: Run static type checks - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - bundle exec srb tc + run: bundle exec srb tc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 40538ec..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Publish Gem - -on: - push: - branches: - - "main" - tags: - - v* -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@5126516654c75f76bca1de45dd82a3006d8890f9 - - - name: Release Gem - if: contains(github.ref, 'refs/tags/v') - uses: cadwallion/publish-rubygems-action@8f9e0538302643309e4e43bf48cd34173ca48cfc - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} diff --git a/sorbet/config b/sorbet/config index 23fef8c..d1aee61 100644 --- a/sorbet/config +++ b/sorbet/config @@ -1,4 +1,5 @@ --dir . --ignore=/spec +--ignore=/vendor/bundle --enable-experimental-requires-ancestor