CI #74
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
tags: | |
- v* | |
- pre-rel-* | |
env: | |
runtime-vm_repository: golemfactory/ya-runtime-vm | |
runtime-vm_version: v0.5.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@v4 | |
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@v4 | |
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') }} |