Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkroh committed May 18, 2023
1 parent 7f7ef6d commit 8b7b407
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ jobs:
- name: Set CGO_ENABLED
run: echo "CGO_ENABLED=${{ matrix.cgo }}" >> $GITHUB_ENV

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest

- name: Test
if: runner.os != 'Windows'
run: .ci/scripts/test.sh
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: release

on:
workflow_dispatch:
inputs:
version:
description: Tag name (e.g. v1.2.3) for this version (does not need to exist).
required: true
type: string
last_release:
description: Last release tag.
required: true
type: string

permissions:
contents: read

jobs:
draft:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
ref: main
fetch-depth: 0 # Need full history.

- name: release notes
run: >-
go run github.com/hashicorp/go-changelog/cmd/changelog-build@ba40b3a
-changelog-template .ci/release/changelog.gotmpl
-entries-dir ./.changelog
-note-template .ci/release/release-note.gotmpl
-last-release "${{ inputs.last_release }}"
-this-release HEAD | tee /tmp/release-notes.txt
- name: draft GH release
run: >-
gh release create "${{ inputs.version }}"
--draft
--notes-file /tmp/release-notes.txt
--title "${{ inputs.version }}"

0 comments on commit 8b7b407

Please sign in to comment.