diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33882ef..1d503a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,30 @@ -name: Tests +name: CI on: push: branches: - - master + - main pull_request: {} jobs: + lint: + name: "pups lint" + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + ruby: ["3.2"] + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rubocop test: name: "pups tests" runs-on: ${{ matrix.os }} @@ -19,7 +37,7 @@ jobs: ruby: ["3.2"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} @@ -27,3 +45,18 @@ jobs: - name: Run minitest run: | rake test + + publish: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: [test] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Release Gem + uses: discourse/publish-rubygems-action@v2 + env: + RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} + GIT_EMAIL: team@discourse.org + GIT_NAME: discoursebot diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 1d2fb48..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Lint - -on: - push: - branches: - - master - pull_request: {} - -jobs: - lint: - name: "pups lint" - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - ruby: ["3.2"] - - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - run: bundle exec rubocop diff --git a/README.md b/README.md index d1d2c58..4b98788 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Running: `pups somefile.yaml` will execute the shell script resulting in a file #### Filtering run commands by tags -The `--tags` and `skip-tags` argument allows pups to target a subset of commands listed in the somefile.yaml. To use this, you may tag your commands in the rublock. `--tags` will only run commands when commands have a matching tag. `skip-tags` will skip when commands have a matching tag. +The `--tags` and `--skip-tags` argument allows pups to target a subset of commands listed in the somefile.yaml. To use this, you may tag your commands in the runblock. `--tags` will only run commands when commands have a matching tag. `--skip-tags` will skip when commands have a matching tag. Note, hooks from tagged commands will be present or absent depending on if the tag is filtered out or not as well. A command filtered out by targeting tag will also filter out the command's `before_` and `after_` hooks.