Skip to content

Release

Release #7

Workflow file for this run

name: Release
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [master]
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Configure git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Bump version
run: |
if [[ "${{ github.event.inputs.version }}" != "" ]]; then
VERSION_TYPE=${{ github.event.inputs.version }}
else
VERSION_TYPE=patch
fi
ruby script/bump-version $VERSION_TYPE
git add -A
git commit -m "chore: bump version"
- name: Get version
id: version
run: echo "version=$(ruby -r ./lib/activeadmin_mitosis_editor/version -e 'puts ActiveAdminMitosisEditor::VERSION')" >> $GITHUB_OUTPUT
- name: Build gem
run: gem build *.gemspec
- name: Publish to RubyGems
uses: rubygems/release-gem@v1
- name: Push changes and tag
run: |
git tag v${{ steps.version.outputs.version }}
git push --follow-tags origin master