-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Trusted Publishing workflow (#536)
- Loading branch information
Showing
4 changed files
with
46 additions
and
5 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,32 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- addressable-* | ||
|
||
jobs: | ||
release: | ||
if: github.repository == 'sporkmonger/addressable' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # for trusted publishing | ||
steps: | ||
# tags are named addressable-VERSION, e.g. addressable-2.8.6 | ||
- name: Set VERSION from git tag | ||
run: echo "VERSION=$(echo ${{ github.ref }} | cut -d - -f 2)" >> "$GITHUB_ENV" | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
ruby-version: ruby | ||
|
||
- uses: rubygems/[email protected] | ||
|
||
# ensure gem can be built and installed | ||
- run: bundle exec rake gem:install | ||
|
||
# push gem to rubygems.org | ||
- run: gem push --verbose pkg/addressable-${VERSION}.gem |
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,12 @@ | ||
# Releasing Addressable | ||
|
||
1. Update `CHANGELOG.md` | ||
1. Update `lib/addressable/version.rb` with the new version | ||
1. Run `rake gem:gemspec` to update gemspec | ||
1. Run `rake gem:install` to sanity check your work | ||
1. Create pull request with all that | ||
1. Merge the pull request when CI is green | ||
1. Ensure you have latest changes locally | ||
1. Run`VERSION=x.y.z rake git:tag:create` to create tag in git | ||
1. Push tag to upstream: `git push --tags upstream` | ||
1. Watch GitHub Actions build and push the gem to RubyGems.org |
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