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/.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..46168843 100644 --- a/README.md +++ b/README.md @@ -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. 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']