-
Notifications
You must be signed in to change notification settings - Fork 28
60 lines (56 loc) · 1.72 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
name: Release
on:
workflow_dispatch:
inputs:
release:
description: 'Release tag'
required: true
previous-tag:
description: 'Previous release tag'
required: true
git-ref:
description: 'Git reference for the release. Use an appropriate release-v* branch, tag, or commit SHA.'
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: Check out code
uses: actions/checkout@v4
with:
ref: ${{ inputs.git-ref }}
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: true
check-latest: true
- name: Tag release
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${{ inputs.release }}" -m "Release ${{ inputs.release }}" --force
git push origin "${{ inputs.release }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Release Changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PREVIOUS_TAG: ${{ 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@v6
with:
args: release --clean --release-notes /tmp/release-notes/Changes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}