-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Modify release notes script to ensure working tree is clean. - Remove chmod +x modification on release notes script. - Use release notes script to draft release notes for goreleaser. - Convert release workflow from a push action to an on-demand action, with current and previous release tags as inputs.
- Loading branch information
1 parent
4f763c3
commit ad1ea67
Showing
2 changed files
with
57 additions
and
30 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,44 @@ | ||
--- | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
inputs: | ||
release: | ||
description: 'Release tag' | ||
required: true | ||
previous-tag: | ||
description: 'Previous release tag' | ||
required: true | ||
jobs: | ||
release: | ||
name: Release | ||
if: ${{ github.repository == 'shipwright-io/cli' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # To be able to update releases | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.inputs.release }} | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Build Release Changelog | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PREVIOUS_TAG: ${{ github.event.inputs.previous-tag }} | ||
# This creates a set of release notes at Changes.md | ||
run: | | ||
export GITHUB_TOKEN | ||
export PREVIOUS_TAG | ||
"${GITHUB_WORKSPACE}/.github/draft_release_notes.sh" | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
args: release --rm-dist --release-notes /tmp/release-notes/Changes.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |