Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHIP-0038: Add Git Ref to Release Workflow #1557

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
tags:
description: 'Previous tag'
required: true
git-ref:
description: 'Git reference to checkout. Use an appropriate release-v* branch name, tag, or commit SHA.'
required: true

jobs:
release:
Expand All @@ -22,11 +25,12 @@ jobs:
env:
IMAGE_HOST: ghcr.io
IMAGE_NAMESPACE: ${{ github.repository }}
TAG: ${{ github.event.inputs.release }}
TAG: ${{ inputs.release }}

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.git-ref }}
fetch-depth: 0 # Fetch all history, needed for release note generation.
- uses: actions/setup-go@v5
with:
Expand All @@ -43,7 +47,7 @@ jobs:
- name: Build Release Changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PREVIOUS_TAG: ${{ github.event.inputs.tags }}
PREVIOUS_TAG: ${{ inputs.tags }}
run: |
# might not be necessary but make sure
chmod +x "${GITHUB_WORKSPACE}/.github/draft_release_notes.sh"
Expand All @@ -55,8 +59,8 @@ jobs:
id: draft_release
uses: actions/create-release@v1
with:
release_name: "Shipwright Build release ${{ github.event.inputs.release }}"
tag_name: ${{ github.event.inputs.release }}
release_name: "Shipwright Build release ${{ inputs.release }}"
tag_name: ${{ inputs.release }}
body_path: Changes.md
draft: true
prerelease: true
Expand All @@ -82,8 +86,8 @@ jobs:

- name: Update docs after release creation
env:
PREVIOUS_TAG: ${{ github.event.inputs.tags }}
NEW_TAG: ${{ github.event.inputs.release }}
PREVIOUS_TAG: ${{ inputs.tags }}
NEW_TAG: ${{ inputs.release }}
run: |
# Update README.md with new tag

Expand All @@ -96,7 +100,7 @@ jobs:
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
git add README.md
git commit -m "Update Readme with new Tag ${{ github.event.inputs.release }}"
git commit -m "Update Readme with new Tag ${{ inputs.release }}"
git clean -f
- name: Create Readme PR
uses: peter-evans/create-pull-request@v6
Expand All @@ -113,7 +117,7 @@ jobs:
Update README.md
# Changes

- Bump tag references to ${{ github.event.inputs.release }}
- Bump tag references to ${{ inputs.release }}

# Submitter Checklist

Expand Down