-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ci with release builder and publisher
Signed-off-by: LeoFVO <[email protected]>
- Loading branch information
Showing
3 changed files
with
242 additions
and
163 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
paths-ignore: | ||
- '*.md' | ||
pull_request: | ||
branches: [master] | ||
paths-ignore: | ||
- '*.md' | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos] | ||
ruby-version: [2.0, 2.1, 2.2, 2.3, 2.4, 2.6] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true | ||
- name: Install dependencies | ||
run: bundle install | ||
- name: Run tests | ||
run: bundle exec rake |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build + Publish | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby 2.6 | ||
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6 | ||
with: | ||
ruby-version: 2.6 | ||
- run: bundle install | ||
|
||
- name: Publish to GPR | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
gem build *.gemspec | ||
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem | ||
env: | ||
GEM_HOST_API_KEY: 'Bearer ${{secrets.GITHUB_TOKEN}}' | ||
OWNER: ${{ github.repository_owner }} | ||
|
||
- name: Publish to RubyGems | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
gem build *.gemspec | ||
gem push *.gem | ||
env: | ||
GEM_HOST_API_KEY: '${{secrets.RUBYGEMS_AUTH_TOKEN}}' |
Oops, something went wrong.