Repository navigation
62 lines (59 loc) · 1.8 KB
/
Copy pathgitagger.yml
File metadata and controls
62 lines (59 loc) · 1.8 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
name: Gitagger
on:
workflow_dispatch:
inputs:
bump:
description: 'Tag bump type'
required: false
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
tag:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install release tools
run: |
go install github.com/goreleaser/goreleaser/v2@latest
go install github.com/go-task/task/v3/cmd/task@latest
cliff_url=$(curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors https://api.github.com/repos/orhun/git-cliff/releases/latest | grep -o 'https://[^"]*x86_64-unknown-linux-gnu\.tar\.gz' | head -n 1)
test -n "$cliff_url"
tmp=$(mktemp -d)
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors "$cliff_url" | tar -xz -C "$tmp"
mv "$tmp"/git-cliff-*/git-cliff "$(go env GOPATH)/bin/"
rm -rf "$tmp"
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Set git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- id: gitagger
uses: CHE3MZ/gitagger@v1
with:
args: ${{ inputs.bump }}
outputs:
tag: ${{ steps.gitagger.outputs.tag }}
publish:
needs: tag
if: needs.tag.outputs.tag != ''
uses: ./.github/workflows/ghcr-docker.yml
with:
tag: ${{ needs.tag.outputs.tag }}
permissions:
contents: read
packages: write
attestations: write
id-token: write