Refactor release-prep and action due to issue running via docker

This commit is contained in:
Jake Spain 2023-08-16 09:34:12 -04:00
parent d6e6d670e6
commit c3f98281c9
No known key found for this signature in database
GPG key ID: BC1C4DA0A085E113
3 changed files with 64 additions and 42 deletions

View file

@ -1,14 +1,22 @@
name: Release Gem name: Release Gem
on: workflow_dispatch on: push
jobs: jobs:
release: validate-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'puppetlabs/vmpooler' if: github.repository == 'puppetlabs/vmpooler'
outputs:
cv: ${{ steps.cv.outputs.version }}
nv: ${{ steps.nv.outputs.version }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 'ruby-3.1'
- name: Get Current Version - name: Get Current Version
uses: actions/github-script@v6 uses: actions/github-script@v6
id: cv id: cv
@ -30,10 +38,9 @@ jobs:
echo "Found version $version from lib/vmpooler/version.rb" echo "Found version $version from lib/vmpooler/version.rb"
- name: Generate Changelog - name: Generate Changelog
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2 run : |
with: gem install github_changelog_generator -v '~> 1.15.2'
args: >- CONSOLE_LEVEL=debug github_changelog_generator --future-release ${{ steps.nv.outputs.version }}
--future-release ${{ steps.nv.outputs.version }}
env: env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -51,39 +58,60 @@ jobs:
fi fi
- name: Generate Release Notes - name: Generate Release Notes
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2 run : |
with: github_changelog_generator \
args: >- --since-tag ${{ steps.cv.outputs.result }} \
--since-tag ${{ steps.cv.outputs.result }} --future-release ${{ steps.nv.outputs.version }} \
--future-release ${{ steps.nv.outputs.version }}
--output release-notes.md --output release-notes.md
env: env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tag Release - uses: actions/upload-artifact@v3
uses: ncipollo/release-action@v1
with: with:
tag: ${{ steps.nv.outputs.version }} name: release-notes
token: ${{ secrets.GITHUB_TOKEN }} path: release-notes.md
bodyfile: release-notes.md
draft: false
prerelease: false
# This step should closely match what is used in `docker/Dockerfile` in vmpooler-deployment publish-release:
- name: Install Ruby jruby-9.4.3.0 runs-on: ubuntu-latest
uses: ruby/setup-ruby@v1 needs: validate-release
if: github.repository == 'puppetlabs/vmpooler'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with: with:
ruby-version: 'jruby-9.4.3.0' name: release-notes
path: release-notes.md
- name: Build gem - name: Test Outputs
run: gem build *.gemspec run : |
cat release-notes.md
echo ${{ needs.validate-release.outputs.nv.version }}
- name: Publish gem # - name: Tag Release
run: | # uses: ncipollo/release-action@v1
mkdir -p $HOME/.gem # with:
touch $HOME/.gem/credentials # tag: ${{ needs.validate-release.outputs.nv.version }}
chmod 0600 $HOME/.gem/credentials # token: ${{ secrets.GITHUB_TOKEN }}
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials # bodyfile: release-notes.md
gem push *.gem # draft: false
env: # prerelease: false
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
# # This step should closely match what is used in `docker/Dockerfile` in vmpooler-deployment
# - name: Install Ruby jruby-9.4.3.0
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 'jruby-9.4.3.0'
# - 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 }}'

View file

@ -1,13 +1,9 @@
# Changelog # Changelog
## [3.3.0](https://github.com/puppetlabs/vmpooler/tree/3.3.0) (2023-08-15) ## [3.3.0](https://github.com/puppetlabs/vmpooler/tree/3.3.0) (2023-08-16)
[Full Changelog](https://github.com/puppetlabs/vmpooler/compare/3.2.0...3.3.0) [Full Changelog](https://github.com/puppetlabs/vmpooler/compare/3.2.0...3.3.0)
**Implemented enhancements:**
- \(RE-15162\) Update Redis gem to version 5.0. [\#561](https://github.com/puppetlabs/vmpooler/pull/561) ([isaac-hammes](https://github.com/isaac-hammes))
**Closed issues:** **Closed issues:**
- Redis 5.x Deprecations [\#603](https://github.com/puppetlabs/vmpooler/issues/603) - Redis 5.x Deprecations [\#603](https://github.com/puppetlabs/vmpooler/issues/603)

View file

@ -9,7 +9,5 @@ docker run -it --rm \
/bin/bash -c 'apt-get update -qq && apt-get install -y --no-install-recommends git make netbase && cd /app && gem install bundler && bundle install --jobs 3; echo "LOCK_FILE_UPDATE_EXIT_CODE=$?"' /bin/bash -c 'apt-get update -qq && apt-get install -y --no-install-recommends git make netbase && cd /app && gem install bundler && bundle install --jobs 3; echo "LOCK_FILE_UPDATE_EXIT_CODE=$?"'
# Update Changelog # Update Changelog
docker run -it --rm -e CHANGELOG_GITHUB_TOKEN -v $(pwd):/usr/local/src/your-app \ gem install github_changelog_generator -v '~> 1.15.2'
githubchangeloggenerator/github-changelog-generator:1.16.2 \ github_changelog_generator --future-release $(grep VERSION lib/vmpooler/version.rb |rev |cut -d "'" -f2 |rev)
github_changelog_generator --future-release $(grep VERSION lib/vmpooler/version.rb |rev |cut -d "'" -f2 |rev)