-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 1.82 KB
/
release_pr.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_pr
run-name: release PR ${{ github.ref }}@${{ github.sha }}
on:
workflow_dispatch:
inputs:
url:
description: Github repository URL to point links at, prefixed 'https://github.com/'
required: true
type: string
title:
description: Release title; new version and date will be added
type: string
tag_prefixes:
description: Comma separated prefixes to find tags, i.e ${PREFIX}v1.0.0
type: string
jobs:
release_pr:
name: release PR
runs-on: ubuntu-latest
steps:
- name: Validate branch
if: github.ref != 'refs/heads/main' && github.event.local != true
run: |
echo expected main, got: ${{ github.ref }} && exit 1
- name: Checkout
uses: actions/[email protected]
with:
fetch-tags: true
fetch-depth: 0
submodules: true
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.23
- run: go install github.com/tcodes0/go/cmd/changelog@latest
- name: Update changelog
shell: bash
env:
CHANGELOG_FILE: CHANGELOG.md
BASH_ENV: ./lib.sh
TAGS_FILE: tags.txt
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./workflows/release/changelog.sh "${{ inputs.url }}" "${{ inputs.title }}" "${{ inputs.tag_prefixes }}"
- name: Open PR
uses: peter-evans/[email protected]
if: github.event.local != true
with:
commit-message: "chore: release ${{ inputs.title }}"
title: "chore: release ${{ inputs.title }}"
add-paths: .
body: ""
committer: release-workflow <41898282+github-actions[bot]@users.noreply.github.com>
branch: release-${{ inputs.title }}
branch-suffix: random