-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (65 loc) · 2.04 KB
/
release.yaml
File metadata and controls
66 lines (65 loc) · 2.04 KB
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
61
62
63
64
65
66
name: release
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
permissions:
id-token: write
pull-requests: write
contents: write
jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'bwagner5/api-call-analyzer'
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
shell: bash
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/
~/go/bin/
key: ${{ runner.os }}-go-cache-${{ hashFiles('go.sum', 'hack/toolchain.sh') }}
- run: make toolchain verify
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload assets
uses: actions/upload-artifact@v3
with:
name: aca
path: dist/*
- run: |
make update-readme
RELEASE_VERSION=${GITHUB_REF#refs/*/}
git config user.name "Release"
git config user.email "release@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}
git config pull.rebase false
BRANCH_NAME="release-${RELEASE_VERSION}"
git checkout -b "${BRANCH_NAME}"
git add README.md
git commit -m "Release updates ${RELEASE_VERSION}."
git push --set-upstream origin "${BRANCH_NAME}"
gh pr create --title "chore: Release ${RELEASE_VERSION}" --body "Release ${RELEASE_VERSION}" --base main --head "release-${RELEASE_VERSION}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}