WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Release Gem
description: |
This workflow creates a new release on GitHub and publishes the gem to
RubyGems.org.

The workflow uses the `googleapis/release-please-action` to handle the
release creation process and the `rubygems/release-gem` action to publish
the gem.

on:
push:
branches: ["main"]

workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

environment:
name: RubyGems
url: https://rubygems.org/gems/github_pages_rake_tasks

permissions:
contents: write
pull-requests: write
id-token: write

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

- name: Create release
uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.AUTO_RELEASE_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

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

- name: Push to RubyGems.org
uses: rubygems/release-gem@v1
if: ${{ steps.release.outputs.release_created }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.1"
}
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ rescue Bundler::BundlerError => e
exit e.status_code
end

# Make it so that calling `rake release` just calls `rake release:rubygems_push` to
# avoid creating and pushing a new tag.

Rake::Task['release'].clear
desc 'Customized release task to avoid creating a new tag'
task release: 'release:rubygem_push'

CLEAN << 'pkg'
CLEAN << 'Gemfile.lock'

Expand Down
22 changes: 22 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"bootstrap-sha": "63e60714532721c2f407d6c15d7f80d4b3062db8",
"packages": {
".": {
"release-type": "ruby",
"package-name": "github_pages_rake_tasks",
"changelog-path": "CHANGELOG.md",
"version-file": "lib/github_pages_rake_tasks/version.rb",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": false,
"include-component-in-tag": false
}
},
"plugins": [
{
"type": "sentence-case"
}
],
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}