Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

110036: add workflows and readme for publishing releases #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
28 changes: 28 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

changelog:
categories:
- title: Breaking Changes 🚧
labels:
# Semver-Major
- breaking change
- title: New Features ✨
labels:
# Semver-Minor
- enhancement
- title: Bug Fixes 🐛
labels:
# Semver-Patch
- bugfix
- title: Other Changes 📦
labels:
- "*"
exclude:
labels:
- chore
- version bump
21 changes: 21 additions & 0 deletions .github/workflows/label-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Label Checker

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

jobs:
check_labels:
name: Check labels
runs-on: ubuntu-latest
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
# At least one of the labels listed below must be present on the PR for the check to pass
any_of: breaking change,enhancement,bugfix,version bump,release,chore,documentation
repo_token: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish Release

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" \
--repo="$GITHUB_REPOSITORY" \
--title="${{ github.ref_name }}" \
--generate-notes
31 changes: 31 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Release

This file describes the process for publishing a new version of the gem as a GitHub release.

Releases are managed through the [GitHub Releases](https://github.com/dchbx/event_source/releases) page.

Release names follow the [Semantic Versioning](https://semver.org/) standard.

Follow the steps below to package and release a new version of the gem.

## Local Release Preparation
1. Checkout the main branch and pull the latest changes.
2. Create a branch named after the version you are releasing, e.g., v1.0.0.
3. Update the version number in the `lib/event_source/version.rb` file. Note the [correct format](https://guides.rubygems.org/specification-reference/#version); only digits and dots are allowed. Do not include a `v` prefix.
4. Update the `Gemfile.lock` file using the most appropriate command:
- `bundle update --patch --conservative event_source` for a patch release.
- `bundle update --minor --conservative event_source` for a minor release.
- `bundle update --major --conservative event_source` for a major release.
- See bundler documentation for detailed information on how these [commands](https://bundler.io/v2.5/man/bundle-update.1.html) behave.
5. Commit the changes with a message like `bump version to v1.0.0`.
6. Push the branch and raise a pull request against trunk. The pull request title should follow the format: `bump version to v1.0.0`. Be sure to label the pull request with the `version-bump` label.


## Publishing the Release
1. Once the pull request is approved and merged, checkout the main branch and pull the latest changes.
2. Create a new annotated tag with the version number, e.g., `git tag -a v1.0.0 -m "v1.0.0"`.
3. Push the tag to the remote repository, e.g., `git push origin refs/tags/v1.0.0`.
4. GitHub Actions will automatically create a new release on the [GitHub Releases](https://github.com/dchbx/event_source/releases) page with release notes. Confirm that the release was successfully published there and that all intended commits are included in the release.

## Using a Tagged Release in Another Project
To use the new release in another project, update the project's `Gemfile` to reference the release's tag, e.g., `gem 'event_source', git: 'https://github.com/dchbx/event_source.git', tag: 'v1.0.0'`.
Loading