Skip to content

Commit

Permalink
SHIP-0038: Add Git Ref to Release Workflow
Browse files Browse the repository at this point in the history
Update the release workflow to accept a git reference as a parameter.
This will be used to check out the appropriate release branch when
generating artifacts and release notes.

The action was also updated with the following:
- Use the (new?) inputs context, instead of relying on the inputs key
  existing in the `github.events` payload.
- Update the checkout and setup-go actions to more recent versions.

Signed-off-by: Adam Kaplan <[email protected]>
  • Loading branch information
adambkaplan committed Mar 21, 2024
1 parent d210cb0 commit 26db7df
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
previous-tag:
description: 'Previous tag'
required: false
git-ref:
description: 'Git reference for the release. Use an appropriate release-v* branch, tag, or commit SHA.'
required: true
jobs:
release:
# if: ${{ github.repository == 'shipwright-io/build' }}
Expand All @@ -20,14 +23,15 @@ jobs:
env:
IMAGE_HOST: ghcr.io
IMAGE_NAMESPACE: ${{ github.repository }}
VERSION: ${{ github.event.inputs.release }}
VERSION: ${{ inputs.release }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.git-ref }}
fetch-depth: 0 # Fetch all history, needed for release note generation.
# Install tools
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21.x
cache: true
Expand All @@ -54,16 +58,16 @@ jobs:
- name: Build Release Changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PREVIOUS_TAG: ${{ github.event.inputs.previous-tag }}
PREVIOUS_TAG: ${{ inputs.previous-tag }}
REPOSITORY: ${{ github.repository }}
run: |
"${GITHUB_WORKSPACE}/.github/draft_release_notes.sh"
- name: Draft release
id: draft_release
uses: actions/create-release@v1
with:
release_name: ${{ github.event.inputs.release }}
tag_name: ${{ github.event.inputs.release }}
release_name: ${{ inputs.release }}
tag_name: ${{ inputs.release }}
draft: true
prerelease: true
body_path: Changes.md
Expand Down

0 comments on commit 26db7df

Please sign in to comment.