This repository has been archived by the owner on Nov 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (58 loc) · 1.78 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .makerc
- uses: actions/setup-go@v2
with:
go-version: "${{ env.GOLANG_VERSION }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Go mod tidy
run: |
go mod tidy
- name: Gen changelog
run: |
make changelog
env:
GORELEASER_TAG: "${{ env.RELEASE_VERSION }}"
- if: startsWith(github.ref,'refs/tags/v')
name: Release dry-run
run: make release-dry-run
env:
GITHUB_TOKEN: ${{ secrets.GHCR_TOKEN }}
- if: startsWith(github.ref,'refs/tags/v')
name: setup release environment
run: |-
echo '${{secrets.GHCR_USER}}:${{secrets.GHCR_TOKEN}}:ghcr.io' > .docker-creds
echo 'DOCKER_CREDS_FILE=.docker-creds' > .release-env
echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' >> .release-env
- if: startsWith(github.ref,'refs/tags/v')
name: Release
run: |-
sudo rm -rf dist
make release