Skip to content

Commit

Permalink
fix(ci): Add releaser workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanVqz committed Jun 28, 2024
1 parent a69327c commit c080700
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
workflow_dispatch:
push:
branches:
- main

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: write
strategy:
matrix:
ruby: [2.7]
steps:
- name: Release Please
uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
manifest-file: .release-please-manifest.json
config-file: release-please-config.json

- name: Checkout Repository
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4

- name: Set Up Ruby
if: ${{ steps.release.outputs.release_created }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Install Dependencies
if: ${{ steps.release.outputs.release_created }}
run: bundle install

- name: Publish to GitHub Releases
if: ${{ steps.release.outputs.release_created }}
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
if: ${{ steps.release.outputs.release_created }}
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.SIMPLE_FORM_THEME_API_KEY }}"
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
12 changes: 12 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"packages": {
".": {
"release-type": "ruby",
"version-file": "lib/simple_form/theme/version.rb",
"extra-files": [
"CHANGELOG.md",
"Gemfile.lock"
]
}
}
}

0 comments on commit c080700

Please sign in to comment.