Skip to content

Commit cdf1335

Browse files
author
github-actions
committed
Switch to trusted publishing workflow and run it on version.rb changes
1 parent 2843b96 commit cdf1335

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish to RubyGems.org
2+
3+
on:
4+
push:
5+
branches: main
6+
paths: lib/zendesk_apps_support/version.rb
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
environment: rubygems-publish
13+
if: github.repository_owner == 'zendesk'
14+
permissions:
15+
id-token: write
16+
contents: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
bundler-cache: false
23+
24+
- name: Install dependencies
25+
run: bundle install
26+
- uses: rubygems/release-gem@v1

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ This project uses Rspec, which can be run with `bundle exec rake`.
1818
* Put up a PR into the master branch.
1919
* CC and get two +1 from @zendesk/wattle.
2020

21+
### Releasing a new version
22+
A new version is published to RubyGems.org every time a change to `version.rb` is pushed to the `main` branch.
23+
In short, follow these steps:
24+
1. Update `version.rb`,
25+
2. run `bundle lock` to update `Gemfile.lock`,
26+
3. merge this change into `main`, and
27+
4. look at [the action](https://github.com/zendesk/zendesk_apps_support/actions/workflows/publish.yml) for output.
28+
29+
To create a pre-release from a non-main branch:
30+
1. change the version in `version.rb` to something like `1.2.0.pre.1` or `2.0.0.beta.2`,
31+
2. push this change to your branch,
32+
3. go to [Actions → “Publish to RubyGems.org” on GitHub](https://github.com/zendesk/zendesk_apps_support/actions/workflows/publish.yml),
33+
4. click the “Run workflow” button,
34+
5. pick your branch from a dropdown.
35+
2136
## Bugs
2237
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.
2338

lib/zendesk_apps_support/version.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module ZendeskAppsSupport
2+
VERSION = "4.42.0"
3+
end

zendesk_apps_support.gemspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# frozen_string_literal: true
22

3+
require_relative 'lib/zendesk_apps_support/version'
4+
35
Gem::Specification.new do |s|
46
s.name = 'zendesk_apps_support'
5-
s.version = '4.42.0'
7+
s.version = ZendeskAppsSupport::VERSION
68
s.license = 'Apache License Version 2.0'
79
s.authors = ['James A. Rosen', 'Likun Liu', 'Sean Caffery', 'Daniel Ribeiro']
810
s.email = ['dev@zendesk.com']

0 commit comments

Comments
 (0)