SG-31320 Add SECURITY.md file (#40) #29
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: Test and Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' | |
ruby: [2.7, '3.0', 3.1, 3.2] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Run linter | |
run: bundle exec rubocop | |
- name: Run tests | |
run: bundle exec rspec | |
- name: Run type checking (Sorbet) | |
run: bundle exec srb tc | |
prettier: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install yarn dep | |
run: yarn install | |
- name: Check prettier | |
run: yarn prettier -c './!(vendor|sorbet|node_modules)/**/*.rb' Guardfile Rakefile *.gemspec Gemfile | |
release: | |
needs: [tests, prettier] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2 | |
bundler-cache: true | |
- name: Prepare credentials | |
env: | |
RUBYGEM_KEY: ${{ secrets.RUBYGEM_KEY }} | |
run: "mkdir -p ~/.gem && echo -e \"---\\r\\n:rubygems_api_key: $RUBYGEM_KEY\" > ~/.gem/credentials && chmod 0600 ~/.gem/credentials" | |
- name: Setup username/email | |
run: 'git config --global user.email zaratan@hey.com && git config --global user.name "Denis <Zaratan> Pasin"' | |
- name: Fetch tags from remote | |
run: 'git fetch -t' | |
- name: Publish if version change | |
run: 'git diff `git tag | tail -1` -- lib/shotgrid_api_ruby/version.rb | grep -E "^\+.*VERSION" && rake release || echo "No release for now"' |