Skip to content

Commit

Permalink
Merge pull request #311 from EasyPost/automated_releasing
Browse files Browse the repository at this point in the history
feat: automated releasing
  • Loading branch information
Justintime50 authored Jul 30, 2024
2 parents d0f99e8 + b44e932 commit 98beadf
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ jobs:
matrix:
rubyversion: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.rubyversion }}
rubygems: '3.3.0'
Expand All @@ -34,10 +32,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
rubygems: '3.3.0'
Expand All @@ -52,10 +48,8 @@ jobs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
rubygems: '3.3.0'
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release

on:
release:
types: [published]
workflow_dispatch: ~

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
rubygems: '3.3.0'
bundler-cache: true
- name: Build Package
run: make install build
- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
gem push dist/*.gem
env:
RUBYGEMS_API_KEY: '${{secrets.RUBYGEMS_API_KEY}}'
- name: Upload assets to release
uses: AButler/[email protected]
with:
files: 'dist/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 98beadf

Please sign in to comment.