Skip to content

Commit c94b091

Browse files
committed
🆕 Setup CI and prepare to release 0.3.0
1 parent 0a5999e commit c94b091

File tree

7 files changed

+140
-5
lines changed

7 files changed

+140
-5
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '19 13 * * 1'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'ruby' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v2
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v2

.github/workflows/gem-push.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Ruby Gem
2+
3+
on:
4+
push:
5+
tags: [ '*' ]
6+
7+
jobs:
8+
build:
9+
name: Build + Publish
10+
runs-on: ubuntu-latest
11+
environment: production
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Ruby 3.0
19+
uses: actions/setup-ruby@v1
20+
with:
21+
ruby-version: 3.0.x
22+
23+
- name: Publish to GPR
24+
run: |
25+
mkdir -p $HOME/.gem
26+
touch $HOME/.gem/credentials
27+
chmod 0600 $HOME/.gem/credentials
28+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
29+
gem build *.gemspec
30+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
31+
env:
32+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
33+
OWNER: ${{ github.repository_owner }}
34+
35+
- name: Publish to RubyGems
36+
run: |
37+
mkdir -p $HOME/.gem
38+
touch $HOME/.gem/credentials
39+
chmod 0600 $HOME/.gem/credentials
40+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
41+
gem build *.gemspec
42+
gem push *.gem
43+
env:
44+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
strategy:
6+
fail-fast: false
7+
matrix:
8+
os: [ubuntu-latest, macos-latest]
9+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
10+
ruby: [2.7, '3.0', 3.1, head, truffleruby, truffleruby-head]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: ${{ matrix.ruby }}
17+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
18+
- run: bundle exec rspec

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22
All notable changes to this project made by Monade Team are documented in this file. For info refer to team@monade.io
33

4-
## [UNRELEASED]
4+
## [0.3.0] - 2022-08-11
55
### Added
66
- Implement `expand_queryable` to allow inheritance / composition
77
- Support for rails 7

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[![Build Status](https://travis-ci.com/monade/active-queryable.svg?branch=master)](https://travis-ci.com/monade/active-queryable)
1+
![Build Status](https://github.com/monade/active_queryable/actions/workflows/test.yml/badge.svg)
2+
[![Gem Version](https://badge.fury.io/rb/active_queryable.svg)](https://badge.fury.io/rb/active_queryable)
23

34
# Active Queryable
45

@@ -9,7 +10,7 @@ A light and simple gem for sorting / filtering / paginating a model in Rails.
910
Simply add the gem to your Gemfile
1011

1112
```ruby
12-
gem 'active_queryable', github: 'monade/active_queryable'
13+
gem 'active_queryable'
1314
```
1415

1516
or alternatively `bundle add active_queryable`

active_queryable.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
1313
s.email = 'team@monade.io'
1414
s.files = Dir['lib/**/*']
1515
s.test_files = Dir['spec/**/*']
16-
s.required_ruby_version = '>= 2.3.0'
16+
s.required_ruby_version = '>= 2.7.0'
1717
s.homepage = 'https://rubygems.org/gems/active_queryable'
1818
s.license = 'MIT'
1919
s.add_dependency 'activesupport', ['>= 5', '< 8']

lib/active_queryable/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ActiveQueryable
2-
VERSION = '0.3.0-dev'
2+
VERSION = '0.3.0'
33
end

0 commit comments

Comments
 (0)