-
Notifications
You must be signed in to change notification settings - Fork 20
62 lines (50 loc) · 1.55 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
name: Build, Test, and Push Docker Image
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get the version from the tag
id: get_version
run: |
VERSION=${GITHUB_REF##*/}
VERSION=${VERSION#v}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Install ocl-icd-opencl-dev
run: |
sudo apt-get update && sudo apt-get install -y ocl-icd-opencl-dev
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run Tests
run: |
go test -v -parallel 1 $(go list -f '{{.Dir}}/...' -m | xargs)
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: bananocoin/pippin:latest,bananocoin/pippin:${{ env.VERSION }}
build-args: VERSION=${{ env.VERSION }}