From cdf1335e422c4300176442765e0b540b0f67bbfa Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 23 May 2025 14:23:14 +0000 Subject: [PATCH 1/2] Switch to trusted publishing workflow and run it on version.rb changes --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ README.md | 15 +++++++++++++++ lib/zendesk_apps_support/version.rb | 3 +++ zendesk_apps_support.gemspec | 4 +++- 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml create mode 100644 lib/zendesk_apps_support/version.rb diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..1d329fd6 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 diff --git a/README.md b/README.md index 555f2588..d5fc5ff1 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,21 @@ This project uses Rspec, which can be run with `bundle exec rake`. * Put up a PR into the master 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. diff --git a/lib/zendesk_apps_support/version.rb b/lib/zendesk_apps_support/version.rb new file mode 100644 index 00000000..dbcbecf8 --- /dev/null +++ b/lib/zendesk_apps_support/version.rb @@ -0,0 +1,3 @@ +module ZendeskAppsSupport + VERSION = "4.42.0" +end diff --git a/zendesk_apps_support.gemspec b/zendesk_apps_support.gemspec index 258d29c0..8949f449 100644 --- a/zendesk_apps_support.gemspec +++ b/zendesk_apps_support.gemspec @@ -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'] From 7f49e8093a27addf938ee7eb879e4486d22a7f74 Mon Sep 17 00:00:00 2001 From: Marcio Horoiwa Date: Tue, 27 May 2025 11:06:47 +1000 Subject: [PATCH 2/2] Rename master branch to main --- .github/workflows/actions.yml | 1 - README.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index f0675923..39dbf6fa 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -4,7 +4,6 @@ on: pull_request: push: branches: - - master - main jobs: diff --git a/README.md b/README.md index d5fc5ff1..46168843 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ 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