-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (81 loc) · 2.53 KB
/
ci.yml
File metadata and controls
99 lines (81 loc) · 2.53 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: extractions/setup-just@v2
- name: Check (fmt + vet + test + QA smoke)
run: just check
- name: Build all binaries
run: just build
docker:
needs: check
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: extractions/setup-just@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
env:
DOCKER_REPO: ${{ secrets.DOCKERHUB_USERNAME }}/taskflow
run: |
just docker-build-cached
just docker-push latest
just docker-push ${{ github.sha }}
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
just docker-push "${{ github.ref_name }}"
fi
release:
needs: check
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: extractions/setup-just@v2
- name: Build release archives
run: just dist
- name: Generate release notes
id: notes
run: |
# Find the previous tag.
PREV=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git rev-list --max-parents=0 HEAD)
echo "## What's Changed" > release-notes.md
echo "" >> release-notes.md
git log --pretty=format:"- %s" "${PREV}..HEAD" --no-merges --grep="^Update CHANGELOG" --invert-grep >> release-notes.md
echo "" >> release-notes.md
echo "" >> release-notes.md
echo "**Docker:** \`docker pull ${{ secrets.DOCKERHUB_USERNAME }}/taskflow:${{ github.ref_name }}\`" >> release-notes.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release-notes.md
files: dist/*.tar.gz
generate_release_notes: false