Skip to content

viridian workflow renamed to viridian #42

viridian workflow renamed to viridian

viridian workflow renamed to viridian #42

Workflow file for this run

name: Build cylon images
on:
push:
tags:
- 'v*.*.*'
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v3
with:
go-version: 1.16
id: go
- name: Install Dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
build-essential \
libssl-dev \
uuid-dev \
libgpgme11-dev \
squashfs-tools \
libseccomp-dev \
pkg-config \
debootstrap \
debian-keyring \
debian-archive-keyring \
rsync
- name: Install Singularity
env:
SINGULARITY_VERSION: 3.5.3
GOPATH: /tmp/go
run: |
mkdir -p $GOPATH
sudo mkdir -p /usr/local/var/singularity/mnt
mkdir -p $GOPATH/src/github.com/sylabs
cd $GOPATH/src/github.com/sylabs
wget https://github.com/hpcng/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-${SINGULARITY_VERSION}.tar.gz
tar -xzf singularity-${SINGULARITY_VERSION}.tar.gz
cd singularity
./mconfig -v -p /usr/local
make -j `nproc 2>/dev/null || echo 1` -C ./builddir all
sudo make -C ./builddir install
- name: Check out code for the container build
uses: actions/checkout@v3
- name: Set release version if is a release
if: startsWith(github.event.ref, 'refs/tags/v')
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set release version if not a release
if: false == startsWith(github.event.ref, 'refs/tags/v')
run: echo "RELEASE_VERSION=test" >> $GITHUB_ENV
- name: Build Container
env:
SINGULARITY_RECIPE: Singularity.def
OUTPUT_CONTAINER: cylon_${{env.RELEASE_VERSION}}.img
run: |
ls
if [ -f "${SINGULARITY_RECIPE}" ]; then
sudo -E singularity build ${OUTPUT_CONTAINER} ${SINGULARITY_RECIPE}
else
echo "${SINGULARITY_RECIPE} is not found."
echo "Present working directory: $PWD"
ls
fi
- name: Release
if: startsWith(github.event.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
files: cylon_*.img
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}