Repository navigation
92 lines (77 loc) · 2.5 KB
/
Copy pathrelease.yml
File metadata and controls
92 lines (77 loc) · 2.5 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
name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Vet
run: go vet ./...
- name: Test
run: go test ./... -race -cover
release:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
# Full history and tags are required for the changelog.
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
# GoReleaser builds the binaries, generates the changelog, and creates the
# GitHub release (via the API, using GITHUB_TOKEN) with the artefacts
# attached. Installed via its run script — no third-party actions.
- name: Run GoReleaser
run: curl -sfL https://goreleaser.com/static/run | bash -s -- release --clean
env:
# Creates the release in this repo.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Pushes the Homebrew formula to spinloop-ai/homebrew-tap.
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
agent-image:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
# The tag names the image the same way it names the release — GoReleaser
# stamps main.version from it in the binaries job above, and
# DefaultDockerImage builds --dispatch docker's default from the same
# value at runtime, so the two never drift apart.
- name: Resolve the image tag
id: tag
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Log in to ghcr.io
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push
uses: docker/build-push-action@v7
with:
context: images/agent
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/spinloop-ai/agent:${{ steps.tag.outputs.version }}
ghcr.io/spinloop-ai/agent:latest