-
Notifications
You must be signed in to change notification settings - Fork 1
126 lines (108 loc) · 3.72 KB
/
ci.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: CI
on:
push:
tags:
- v*
- pre-rel-*
env:
runtime-vm_repository: golemfactory/ya-runtime-vm
runtime-vm_version: v0.4.1
vm_name: ya-runtime-vm-nvidia
os_name: linux
organisation: golemfactory
docker-img_name: golem-nvidia-base
docker-img_description: Base image with Nvidia drivers for Golem VM images.
jobs:
build-golem_nvidia_base:
name: Build golem-nvidia-base
runs-on: ubuntu-20.04
steps:
- name: Install Musl
run: sudo apt-get install -y musl-tools musl
- uses: actions/checkout@v1
with:
submodules: "recursive"
- name: Tag name and version
id: tag_name
run: |
TAG=${GITHUB_REF##*/}
VERSION=${TAG#v}
VERSION=${VERSION#pre-rel-v}
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./golem_nvidia_base/
push: true
# Always create `latest` tag. If not make `self_test_img` to use currently build image.
tags: |
ghcr.io/${{ env.organisation }}/${{ env.docker-img_name }}:${{ steps.tag_name.outputs.VERSION }}
ghcr.io/${{ env.organisation }}/${{ env.docker-img_name }}:${{ startsWith(steps.tag_name.outputs.TAG, 'pre-rel-') && 'beta' || 'stable' }}
ghcr.io/${{ env.organisation }}/${{ env.docker-img_name }}:latest
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=${{ env.docker-img_description }}
build-deb:
name: Build self test img
needs:
- build-golem_nvidia_base
runs-on: ubuntu-20.04
env:
self-test-img_gvmi: self-test.gvmi
self-test-img_tag: v0.2.0a0
self-test-img_repository: golemfactory/ya-self-test-img
steps:
- uses: actions/checkout@v3
- name: Download self-test image
uses: robinraju/[email protected]
with:
repository: ${{ env.self-test-img_repository }}
tag: ${{ env.self-test-img_tag }}
fileName: self-test-gpu.gvmi
out-file-path: .
tarBall: false
zipBall: false
- name: Download ya-runtime-vm
uses: robinraju/[email protected]
with:
repository: ${{ env.runtime-vm_repository }}
tag: ${{ env.runtime-vm_version }}
fileName: ya-runtime-vm-${{ env.os_name }}-${{ env.runtime-vm_version }}.tar.gz
extract: true
out-file-path: .
tarBall: false
zipBall: false
- name: Build .deb
id: deb
run: |
chmod +x debian/build-deb.sh
mv self-test-gpu.gvmi ${{ env.self-test-img_gvmi }}
./debian/build-deb.sh ${{ github.ref }} ${{ env.self-test-img_gvmi }} ya-runtime-vm-${{ env.os_name }}-${{ env.runtime-vm_version }}/ya-runtime-vm
- uses: actions/upload-artifact@v2
with:
name: deb
path: |
${{ steps.deb.outputs.deb }}
release:
name: Release
needs:
- build-deb
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
with:
name: deb
path: dist/
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: dist/*
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-rel-v') }}