v0.3.0 #30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| name: ruby ${{ matrix.ruby }} | |
| strategy: | |
| matrix: | |
| ruby: | |
| - '3.3.4' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - run: bundle exec rake | |
| # run only on semantic version tag | |
| release: | |
| needs: | |
| - test | |
| if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3.4' | |
| bundler-cache: true | |
| - name: publish gem | |
| env: | |
| DOTENV_PRIVATE_KEY_CI: ${{ secrets.DOTENV_PRIVATE_KEY_CI }} | |
| run: | | |
| curl -fsS https://dotenvx.sh/install.sh | sh | |
| export PATH="$HOME/.dotenvx/bin:$PATH" | |
| export GEM_HOST_API_KEY="$(dotenvx get RUBYGEMS_API_KEY -f .env.ci)" | |
| bundle exec rake release |