Skip to content
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
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.1
- name: Export version from tag name
run: echo "${{ needs.release-please.outputs.version }}" > VERSION
- name: Build Gem
run: gem build *.gemspec
- name: Setup credentials
Expand Down
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ feat: Add support for IPv6 destinations
feat!: Change default server port to 7778
```

### Versioning

The gem version is defined in `lib/deploy_agent/version.rb` as `DeployAgent::VERSION`. The gemspec reads from this constant via `require_relative`. Release-please is configured (via `version-file` in `release-please-config.json`) to automatically bump the version in this file when creating release PRs.

**Do not hardcode the version in `deploy-agent.gemspec`** — it must always reference `DeployAgent::VERSION`.

## Code Style

Ruby 2.7+ syntax required. RuboCop configured with:
Expand Down
4 changes: 3 additions & 1 deletion deploy-agent.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

require_relative 'lib/deploy_agent/version'

Gem::Specification.new do |s|
s.name = 'deploy-agent'
s.version = '1.3.3'
s.version = DeployAgent::VERSION
s.required_ruby_version = '>= 2.7'
s.summary = 'The DeployHQ Agent'
s.description = 'This gem allows you to configure a secure proxy through which DeployHQ can forward connections'
Expand Down
16 changes: 2 additions & 14 deletions lib/deploy_agent/version.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
require "rubygems"
# frozen_string_literal: true

module DeployAgent
VERSION_FILE_PATH = File.expand_path('../../../VERSION', __FILE__)
SPEC_FILE_PATH = File.expand_path('../../../deploy-agent.gemspec', __FILE__)

if File.file?(VERSION_FILE_PATH)
VERSION = File.read(VERSION_FILE_PATH).strip.sub(/\Av/, '')
elsif File.file?(SPEC_FILE_PATH)
VERSION = Gem::Specification::load(SPEC_FILE_PATH).version.to_s
else
puts __FILE__

VERSION = '0.0.0.dev'
end

VERSION = '1.4.0'
end
1 change: 1 addition & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"packages": {
".": {
"release-type": "ruby",
"version-file": "lib/deploy_agent/version.rb",
"changelog-path": "CHANGELOG.md",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
Expand Down