-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from masaakiaoyagi/develop
Release preparation
- Loading branch information
Showing
5 changed files
with
108 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: release-please | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# - release | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
name: Release Ruby gem | ||
environment: | ||
name: rubygems | ||
|
||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v3 | ||
id: release | ||
with: | ||
# default-branch: release | ||
release-type: ruby | ||
package-name: rspec-context_helper | ||
bump-minor-pre-major: true | ||
bump-patch-for-minor-pre-major: false | ||
version-file: "lib/rspec/context_helper/version.rb" | ||
|
||
- uses: actions/checkout@v3 | ||
# with: | ||
# ref: release | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1.2 | ||
bundler-cache: true | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Publish gem to rubygems.org | ||
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.RUBYGEMS_API_KEY}}" | ||
if: ${{ steps.release.outputs.release_created }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Workflow | ||
|
||
## Development | ||
|
||
```mermaid | ||
gitGraph | ||
commit tag: "v0.0.1" | ||
branch develop order: 3 | ||
commit | ||
commit | ||
branch feature order: 4 | ||
commit | ||
commit | ||
checkout develop | ||
merge feature | ||
checkout main | ||
merge develop | ||
branch release-please order: 2 | ||
commit | ||
checkout main | ||
merge release-please tag: "v0.0.2" | ||
``` | ||
|
||
### Release | ||
|
||
```mermaid | ||
sequenceDiagram | ||
actor user as Developer | ||
participant main as GitHub<br />main Branch | ||
participant pr as GitHub<br />Pull Request | ||
participant release as GitHub<br />Release | ||
participant runner as GitHub<br />Actions Runner | ||
participant gem as rubygems.org | ||
user ->> main: push | ||
main -->> runner: run release-please workflow | ||
runner -->> release: look for latest release | ||
Note over runner: update version | ||
runner -->> main: collect commits since all latest releases | ||
Note over runner: update CHANGELOG | ||
runner -->> pr: create PR | ||
user ->> gem: disable MFA | ||
user ->> pr: merge | ||
pr -->> main: merge PR | ||
main -->> runner: run release-please workflow | ||
runner -->> release: create Release | ||
Note over runner: create gem | ||
runner -->> gem: publish gem | ||
user ->> gem: enable MFA | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters