-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.24 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
required: true
description: Version to release
type: string
jobs:
release:
name: Release
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Release
id: release
uses: google-github-actions/release-please-action@v3
with:
release-type: go
package-name: ${{ github.event.repository.name }}
release-as: ${{ github.event.inputs.version }}
- name: Setup Go
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v3
with:
ref: ${{ steps.release.outputs.tag_name }}
- name: Set up Docker Buildx
if: ${{ steps.release.outputs.release_created }}
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
if: ${{ steps.release.outputs.release_created }}
uses: docker/setup-qemu-action@v2
- name: Login to Docker Hub
if: ${{ steps.release.outputs.release_created }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install UPX
if: ${{ steps.release.outputs.release_created }}
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Go Release
if: ${{ steps.release.outputs.release_created }}
uses: goreleaser/goreleaser-action@v4
env:
GITHUB_TOKEN: ${{ github.token }}
with:
distribution: goreleaser
version: latest
args: release
- name: Update Docker Images Description
if: ${{ steps.release.outputs.release_created }}
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: muxiu1997/goet
short-description: single-executable template renderer, powered by go template, sprig.