Skip to content

Commit

Permalink
Merge pull request #1565 from adambkaplan/release-provide-sh
Browse files Browse the repository at this point in the history
Release Workflow Fixes
  • Loading branch information
openshift-merge-bot[bot] authored Apr 2, 2024
2 parents 5300509 + 8e36f8d commit e166016
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
TAG: ${{ inputs.release }}

steps:
- name: Setup release ${{ inputs.release }}
run: |
echo "Creating release ${{ inputs.release }} from previous tag ${{ inputs.tags }} with ref ${{ inputs.git-ref }}"
- uses: actions/checkout@v4
with:
ref: ${{ inputs.git-ref }}
Expand Down Expand Up @@ -57,13 +60,19 @@ jobs:
- name: Draft release
id: draft_release
# TODO: This action is no longer mainained. We should use a different action
# or the gh command line directly.
uses: actions/create-release@v1
with:
release_name: "Shipwright Build release ${{ inputs.release }}"
tag_name: ${{ inputs.release }}
body_path: Changes.md
draft: true
prerelease: true
# create-release assumes one of two things if commitish is not set
# 1. Release is from the "latest commit" on the repo's default branch.
# 2. Release is for an existing tag with the same name
commitish: ${{ inputs.git-ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -78,9 +87,13 @@ jobs:
gh release upload ${TAG} sample-strategies.yaml
- name: Sign released images
# Updated to use the git SHA of the checked out commit. The SHA for
# workflow_dispatch events is the latest SHA of the _branch_ where the
# action was invoked.
run: |
gitsha=$(git rev-parse --verify HEAD)
grep -o "ghcr.io[^\"]*" release.yaml | xargs cosign sign --yes \
-a sha=${{ github.sha }} \
-a sha=${gitsha} \
-a run_id=${{ github.run_id }} \
-a run_attempt=${{ github.run_attempt }}
Expand Down

0 comments on commit e166016

Please sign in to comment.