Skip to content

Switch to trusted publishing workflow and run it on version.rb changes #377

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

Merged
merged 2 commits into from
May 27, 2025
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
1 change: 0 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
push:
branches:
- master
- main

jobs:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish to RubyGems.org

on:
push:
branches: main
paths: lib/zendesk_apps_support/version.rb
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
environment: rubygems-publish
if: github.repository_owner == 'zendesk'
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false

- name: Install dependencies
run: bundle install
- uses: rubygems/release-gem@v1
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,24 @@ Very likely you want to try out your changes with the use of ZAT. See [ZAT](http
This project uses Rspec, which can be run with `bundle exec rake`.

## Contribute
* Put up a PR into the master branch.
* Put up a PR into the main branch.
* CC and get two +1 from @zendesk/wattle.

### Releasing a new version
A new version is published to RubyGems.org every time a change to `version.rb` is pushed to the `main` branch.
In short, follow these steps:
1. Update `version.rb`,
2. run `bundle lock` to update `Gemfile.lock`,
3. merge this change into `main`, and
4. look at [the action](https://github.com/zendesk/zendesk_apps_support/actions/workflows/publish.yml) for output.

To create a pre-release from a non-main branch:
1. change the version in `version.rb` to something like `1.2.0.pre.1` or `2.0.0.beta.2`,
2. push this change to your branch,
3. go to [Actions → “Publish to RubyGems.org” on GitHub](https://github.com/zendesk/zendesk_apps_support/actions/workflows/publish.yml),
4. click the “Run workflow” button,
5. pick your branch from a dropdown.

## Bugs
Bugs can be reported as an issue here on github, or submitted to support@zendesk.com. By mentioning this project it will assigned to the right team.

Expand Down
3 changes: 3 additions & 0 deletions lib/zendesk_apps_support/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module ZendeskAppsSupport
VERSION = "4.42.0"
end
4 changes: 3 additions & 1 deletion zendesk_apps_support.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

require_relative 'lib/zendesk_apps_support/version'

Gem::Specification.new do |s|
s.name = 'zendesk_apps_support'
s.version = '4.42.0'
s.version = ZendeskAppsSupport::VERSION
s.license = 'Apache License Version 2.0'
s.authors = ['James A. Rosen', 'Likun Liu', 'Sean Caffery', 'Daniel Ribeiro']
s.email = ['dev@zendesk.com']
Expand Down