diff --git a/.github/workflows/gempush.yml b/.github/workflows/gempush.yml deleted file mode 100644 index 0d8a445..0000000 --- a/.github/workflows/gempush.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Ruby Gem - -on: - push: - tags: - - 'v*.*.*' - -jobs: - build: - name: Build + Publish - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby 2.6 - uses: actions/setup-ruby@v1 - with: - version: 2.6.x - - - name: Publish to RubyGems - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem build *.gemspec - gem push *.gem - env: - GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..273a263 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: workflow_dispatch + +jobs: + release: + name: Build + Publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Get Version + id: gv + run: | + echo "::set-output name=ver::$(grep VERSION lib/vmfloaty/version.rb |rev |cut -d "'" -f2 |rev)" + + - name: Tag Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.gv.outputs.ver }} + token: ${{ secrets.GITHUB_TOKEN }} + draft: false + prerelease: false + generateReleaseNotes: true + + - name: Set up Ruby 2.7 + uses: actions/setup-ruby@v1 + with: + version: 2.7.x + + - name: Build gem + run: gem build *.gemspec + + - name: Publish gem + run: | + mkdir -p $HOME/.gem + touch $HOME/.gem/credentials + chmod 0600 $HOME/.gem/credentials + printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials + gem push *.gem + env: + GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}} diff --git a/.gitignore b/.gitignore index 5102fb1..1351382 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ build/ /vendor/ /lib/bundler/man/ +.dccache + # for a library or gem, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: Gemfile.lock diff --git a/README.md b/README.md index 4c60f87..15ec356 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ A CLI helper tool for [Puppet's VMPooler](https://github.com/puppetlabs/vmpooler - [VMPooler API](#vmpooler-api) - [Using the Pooler class](#using-the-pooler-class) - [Example Projects](#example-projects) +- [Contributing](#contributing) + - [Code Reviews](#code-reviews) +- [Releasing](#releasing) - [Special thanks](#special-thanks) ## Install @@ -164,6 +167,21 @@ vmfloaty providers a `Pooler` class that gives users the ability to make request - [Brian Cain: vagrant-vmpooler](https://github.com/briancain/vagrant-vmpooler) - Use Vagrant to manage your vmpooler instances +## Contributing + +PR's are welcome! We always love to see how others think this tool can be made better. + +### Code Reviews + +Please wait for multiple code owners to sign off on any notable change. + +## Releasing + +Releasing is a two step process: + +1. Submit a release prep PR that updates `lib/vmfloaty/version.rb` to the desired new version and get that merged +2. Navigate to --> Run workflow --> select "main" branch --> Run workflow. This will publish a GitHub release, build, and push the gem to RubyGems. + ## Special thanks Special thanks to [Brian Cain](https://github.com/briancain) as he is the original author of vmfloaty! Vast amounts of this code exist thanks to his efforts.