mirror of
https://github.com/puppetlabs/vmpooler-provider-gce.git
synced 2026-01-26 03:18:41 -05:00
Update release workflow
This commit is contained in:
parent
733856809c
commit
91cf44d54a
1 changed files with 59 additions and 7 deletions
66
.github/workflows/release.yml
vendored
66
.github/workflows/release.yml
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
name: Release
|
name: Release Gem
|
||||||
|
|
||||||
on: workflow_dispatch
|
on: workflow_dispatch
|
||||||
|
|
||||||
|
|
@ -7,25 +7,77 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'puppetlabs/vmpooler-provider-gce'
|
if: github.repository == 'puppetlabs/vmpooler-provider-gce'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Get Version
|
|
||||||
id: gv
|
- name: Get Current Version
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
id: cv
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { data: response } = await github.rest.repos.getLatestRelease({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
})
|
||||||
|
console.log(`The latest release is ${response.tag_name}`)
|
||||||
|
return response.tag_name
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
|
- name: Get Next Version
|
||||||
|
id: nv
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=ver::$(grep VERSION lib/vmpooler-provider-gce/version.rb |rev |cut -d "'" -f2 |rev)"
|
version=$(grep VERSION lib/vmpooler-provider-gce/version.rb |rev |cut -d "'" -f2 |rev)
|
||||||
|
echo "version=$version" >> $GITHUB_OUTPUT
|
||||||
|
echo "Found version $version from lib/vmpooler-provider-gce/version.rb"
|
||||||
|
|
||||||
|
- name: Generate Changelog
|
||||||
|
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2
|
||||||
|
with:
|
||||||
|
args: >-
|
||||||
|
--future-release ${{ steps.nv.outputs.version }}
|
||||||
|
env:
|
||||||
|
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Validate Changelog
|
||||||
|
run : |
|
||||||
|
set -e
|
||||||
|
if [[ -n $(git status --porcelain) ]]; then
|
||||||
|
echo "Here is the current git status:"
|
||||||
|
git status
|
||||||
|
echo
|
||||||
|
echo "The following changes were detected:"
|
||||||
|
git --no-pager diff
|
||||||
|
echo "Uncommitted PRs found in the changelog. Please submit a release prep PR of changes after running `./update-changelog`"
|
||||||
|
exit 1
|
||||||
|
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 }}
|
||||||
|
--output release-notes.md
|
||||||
|
env:
|
||||||
|
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Tag Release
|
- name: Tag Release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
tag: ${{ steps.gv.outputs.ver }}
|
tag: ${{ steps.nv.outputs.version }}
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
bodyfile: release-notes.md
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
generateReleaseNotes: true
|
|
||||||
|
# This step should closely match what is used in `docker/Dockerfile` in vmpooler-deployment
|
||||||
- name: Install Ruby jruby-9.3.6.0
|
- name: Install Ruby jruby-9.3.6.0
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 'jruby-9.3.6.0'
|
ruby-version: 'jruby-9.3.6.0'
|
||||||
|
|
||||||
- name: Build gem
|
- name: Build gem
|
||||||
run: gem build *.gemspec
|
run: gem build *.gemspec
|
||||||
|
|
||||||
- name: Publish gem
|
- name: Publish gem
|
||||||
run: |
|
run: |
|
||||||
mkdir -p $HOME/.gem
|
mkdir -p $HOME/.gem
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue