-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 1.57 KB
/
master.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
name: master
on:
push: {}
jobs:
master:
runs-on: ubuntu-latest
steps:
- name: Set lowercase image name
run: echo IMAGE=ghcr.io/${SLUG,,} >>$GITHUB_ENV
env:
SLUG: ${{ github.repository }}
- uses: actions/checkout@v3
- name: Set TAG
run: grep -F . Tagfile && echo TAG=$(cat Tagfile) >>$GITHUB_ENV
- uses: docker/[email protected]
- name: Log in to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/[email protected]
with:
files: ./docker-bake.hcl
targets: goreleaser-dist
# TODO: cache-to
# set: |
# *.cache-to=type=registry,ref=${{ env.IMAGE }}:goreleaser-dist,mode=max
# TODO: cache-to
# - name: If on master push image to GHCR
# run: docker push ${{ env.IMAGE }}:goreleaser-dist
- name: Test CLI
run: |
tar zxvf ./dist/monkey-Linux-x86_64.tar.gz -C .
./monkey -h | grep monkey
./monkey help | grep monkey
./monkey version
./monkey fmt
[[ $(./monkey version | wc -l) = 1 ]]
./monkey version | grep -F $(cat Tagfile)
./monkey --version | grep -F $(cat Tagfile)
- uses: ncipollo/[email protected]
if: github.ref == 'refs/heads/master'
with:
artifacts: ./dist/*
commit: master # Required to push tag
tag: ${{ env.TAG }} # Required to push tag
token: ${{ secrets.GITHUB_TOKEN }}