remove mage, add makefile (#32) #205
This file contains 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 | |
- v* | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- v* | |
# Run tests for PRs | |
pull_request: | |
env: | |
VAULT_ADDR: https://vault.eng.aserto.com/ | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: [3.0, 3.1, 3.2, 3.3] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Run rubocop | |
run: bundle exec rubocop --parallel | |
- name: Set up Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Install topaz | |
run: brew tap aserto-dev/tap && brew install aserto-dev/tap/topaz && topaz install | |
- name: run RSpec | |
run: bundle exec rake spec:all | |
release: | |
runs-on: ubuntu-latest | |
needs: [test] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
name: Release to rubygems | |
steps: | |
- name: Read Configuration | |
uses: hashicorp/vault-action@v3 | |
id: vault | |
with: | |
url: ${{ env.VAULT_ADDR }} | |
token: ${{ secrets.VAULT_TOKEN }} | |
secrets: | | |
kv/data/rubygems "RUBYGEMS_API_KEY" | GEM_HOST_API_KEY; | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: make deps | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3 | |
- name: Build and push the gem | |
run: make release | |
- name: Bump to the next version | |
run: make bump-version | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: 'Bump to next version' | |
add: 'VERSION' | |
push: origin HEAD:main |