release #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "release" | |
on: | |
workflow_dispatch: | |
inputs: | |
target: | |
description: "The target for the release. This can be a commit sha or a branch." | |
required: false | |
default: "main" | |
type: "string" | |
jobs: | |
release: | |
name: "Release" | |
runs-on: "ubuntu-latest" | |
if: github.repository_owner == 'puppetlabs' | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
with: | |
ref: ${{ github.event.inputs.target }} | |
clean: true | |
fetch-depth: 0 | |
- name: "Setup ruby" | |
uses: "ruby/setup-ruby@v1" | |
with: | |
ruby-version: "2.7" | |
bundler-cache: "true" | |
- name: "Bundle environment" | |
run: | | |
echo ::group::bundler environment | |
bundle env | |
echo ::endgroup:: | |
- name: "Get version" | |
id: "get_version" | |
run: | | |
echo "version=$(ruby -e "require './lib/puppet_editor_services/version'; puts PuppetEditorServices::PUPPETEDITORSERVICESVERSION.to_s")" >> $GITHUB_OUTPUT | |
- name: "Build" | |
run: | | |
bundle exec rake build | |
- name: "Generate release notes" | |
run: | | |
export GH_HOST=github.com | |
gh extension install chelnak/gh-changelog | |
gh changelog get --latest > OUTPUT.md | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Create release" | |
run: | | |
gh release create v${{ steps.get_version.outputs.version }} ./output/* --title v${{ steps.get_version.outputs.version }} -F OUTPUT.md | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |