Skip to content

Commit

Permalink
feat: add ci (#3)
Browse files Browse the repository at this point in the history
* chore: add release please

* chore: remove redundant job
  • Loading branch information
ganchdev authored Oct 25, 2023
1 parent 8654191 commit 46f1dfc
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.2.5"
}
67 changes: 67 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"pull-request-header": ":robot: I have created a release",
"packages": {
".": {
"release-type": "ruby",
"changelog-path": "CHANGELOG.md",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": false
}
},
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "feature",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "style",
"section": "Styles"
},
{
"type": "chore",
"section": "Miscellaneous Chores"
},
{
"type": "refactor",
"section": "Code Refactoring"
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
],
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI
on: [push]

jobs:
release-please:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
version: ${{ steps.release-please.outputs.version }}
steps:
- uses: krystal/release-please-manifest-action@v1
id: release-please
with:
app-id: ${{ vars.RELEASE_PLEASE_GITHUB_APP_ID }}
private-key: ${{ secrets.RELEASE_PLEASE_GITHUB_APP_PRIVATE_KEY }}

release:
runs-on: ubuntu-latest
needs: [release-please]
if: needs.release-please.outputs.release_created
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 3.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
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{secrets.KRYSTAL_RUBYGEMS_API_KEY}}
- name: Publish to RubyGems
run: |
gem push *.gem
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
*/*.pem
server/psk
*.gem
.ruby-version
.idea
Gemfile.lock
26 changes: 0 additions & 26 deletions Gemfile.lock

This file was deleted.

27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Deploy Agent Client

This gem allows you to configure a secure proxy through which DeployHQ can forward connections.

## Installation

You'll need Ruby installed on your system. We've tested on 2.7.8 and later.
```
gem install deploy-agent
```

## Usage

Setup agent in a new host
```
$ deploy-agent setup
```

Run agent in foreground
```
$ deploy-agent run
```

Start agent in background
```
$ deploy-agent start
```
7 changes: 3 additions & 4 deletions deploy-agent.gemspec
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
Gem::Specification.new do |s|
s.name = 'deploy-agent'
s.version = '1.2.5'
s.version = '1.2.6'
s.summary = "The DeployHQ Agent"
s.description = "This gem allows you to configure a secure proxy through which DeployHQ can forward connections"
s.authors = ["aTech Media"]
s.authors = ["Charlie Smurthwaite"]
s.email = ["support@deployhq.com"]
s.files = Dir.glob("{lib,bin}/**/*")
s.files << "ca.crt"
s.files << "deploy-agent.gemspec"
s.homepage = 'https://www.deployhq.com/'
s.bindir = "bin"
s.executables << 'deploy-agent'

s.add_runtime_dependency 'nio4r', '2.1.0'
s.add_runtime_dependency 'timers', '4.1.2'
s.add_runtime_dependency 'rb-readline', '0.5.5'

s.add_development_dependency "bundler", "~> 1.16"
end
1 change: 1 addition & 0 deletions lib/deploy_agent.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'deploy_agent/version'
require 'deploy_agent/configuration_generator'
require 'deploy_agent/server_connection'
require 'deploy_agent/destination_connection'
Expand Down
2 changes: 1 addition & 1 deletion lib/deploy_agent/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def accesslist
end

def version
puts "You are running version 1.2.3 of the DeployHQ Agent"
puts DeployAgent::VERSION
end

private
Expand Down
17 changes: 17 additions & 0 deletions lib/deploy_agent/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require "rubygems"

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

end

0 comments on commit 46f1dfc

Please # to comment.