Skip to content

Commit

Permalink
Configure automatic rubygem releases
Browse files Browse the repository at this point in the history
  • Loading branch information
sfnelson committed May 13, 2024
1 parent bde3ab0 commit 14862cb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ updates:
schedule:
interval: "monthly"
groups:
bundler:
ruby:
patterns:
- "*"
37 changes: 18 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,29 @@ name: Release
on:
push:
tags: [ v* ]

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Generate Release Notes
uses: octokit/[email protected]
id: get_release_notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
route: POST /repos/${{ github.repository }}/releases/generate-notes
tag_name: ${{ github.ref_name }}
previous_tag_name: ${{ steps.last_release.outputs.tag }}
- name: Set Release content
bundler-cache: true
- name: Setup
run: |
bin/setup
- uses: rubygems/release-gem@v1
- name: Create GitHub release
run: |
echo "RELEASE_CONTENT<<EOF" >> $GITHUB_ENV
echo "${{ fromJson(steps.get_release_notes.outputs.data).body }}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Generate Release
uses: octokit/[email protected]
tag_name="$(git describe --tags --abbrev=0)"
gh release create "${tag_name}" --verify-tag --generate-notes --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
route: POST /repos/${{ github.repository }}/releases
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body: ${{ toJSON(env.RELEASE_CONTENT) }}
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run setup
- name: Setup
run: |
bin/setup
- name: Run default rake task
- name: Test
run: |
bundle exec rake

0 comments on commit 14862cb

Please sign in to comment.