Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancyq committed Sep 8, 2024
1 parent f576b0d commit 4227f02
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release New Version
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
version:
description: Gem Version
required: true
type: string

jobs:
rubygems:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
environment: release
timeout-minutes: 3

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler: latest

- name: Set git remote
run: |
# Attribute commits to the last committer on HEAD
git config --global user.email "$(git log -1 --pretty=format:'%ae')"
git config --global user.name "$(git log -1 --pretty=format:'%an')"
git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY"
shell: bash

- name: Configure RubyGems trusted publishing credentials
uses: rubygems/[email protected]

- run: "bin/release ${{ inputs.version }}"
shell: bash

0 comments on commit 4227f02

Please sign in to comment.