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
on: workflow_dispatch
on: push
jobs:
release:
validate-release:
runs-on: ubuntu-latest
if: github.repository == 'puppetlabs/vmpooler'
outputs:
cv: ${{ steps.cv.outputs.version }}
nv: ${{ steps.nv.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Install Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 'ruby-3.1'
- name: Get Current Version
uses: actions/github-script@v6
id: cv
@ -30,10 +38,9 @@ jobs:
echo "Found version $version from lib/vmpooler/version.rb"
- name: Generate Changelog
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2
with:
args: >-
--future-release ${{ steps.nv.outputs.version }}
run : |
gem install github_changelog_generator -v '~> 1.15.2'
CONSOLE_LEVEL=debug github_changelog_generator --future-release ${{ steps.nv.outputs.version }}
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -51,39 +58,60 @@ jobs:
fi
- name: Generate Release Notes
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2
with:
args: >-
--since-tag ${{ steps.cv.outputs.result }}
--future-release ${{ steps.nv.outputs.version }}
run : |
github_changelog_generator \
--since-tag ${{ steps.cv.outputs.result }} \
--future-release ${{ steps.nv.outputs.version }} \
--output release-notes.md
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tag Release
uses: ncipollo/release-action@v1
- uses: actions/upload-artifact@v3
with:
tag: ${{ steps.nv.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
bodyfile: release-notes.md
draft: false
prerelease: false
name: release-notes
path: release-notes.md
# 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
publish-release:
runs-on: ubuntu-latest
needs: validate-release
if: github.repository == 'puppetlabs/vmpooler'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
ruby-version: 'jruby-9.4.3.0'
name: release-notes
path: release-notes.md
- name: Build gem
run: gem build *.gemspec
- name: Test Outputs
run : |
cat release-notes.md
echo ${{ needs.validate-release.outputs.nv.version }}
- 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 }}'
# - name: Tag Release
# uses: ncipollo/release-action@v1
# with:
# tag: ${{ needs.validate-release.outputs.nv.version }}
# token: ${{ secrets.GITHUB_TOKEN }}
# bodyfile: release-notes.md
# draft: false
# prerelease: false
# # 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
## [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)
**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:**
- 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=$?"'
# Update Changelog
docker run -it --rm -e CHANGELOG_GITHUB_TOKEN -v $(pwd):/usr/local/src/your-app \
githubchangeloggenerator/github-changelog-generator:1.16.2 \
github_changelog_generator --future-release $(grep VERSION lib/vmpooler/version.rb |rev |cut -d "'" -f2 |rev)
gem install github_changelog_generator -v '~> 1.15.2'
github_changelog_generator --future-release $(grep VERSION lib/vmpooler/version.rb |rev |cut -d "'" -f2 |rev)