Skip to content

Build 2 pkg version (#4) #3

Build 2 pkg version (#4)

Build 2 pkg version (#4) #3

name: Tag and publish
on:
push:
branches:
- main
jobs:
tag:
name: Bump version
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.tag_version.outputs.new_version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "main"
fetch-depth: 0
token: ${{ secrets.SERVICE_TOKEN }}
- name: Compute new version number
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.SERVICE_TOKEN }}
release_branches: "main"
default_bump: patch
dry_run: false
publish:
runs-on: ubuntu-latest
env:
GO_VERSION: '1.14.12'
GO_OS: 'linux'
GO_ARCH: 'amd64'
SINGULARITY_VERSION: '3.7.0'
needs: tag
steps:
- uses: actions/checkout@v3
- name: Pull latest changes
run: git pull origin main
- 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 \
wget \
pkg-config \
procps
- name: Install GO
run: |
wget https://dl.google.com/go/go$GO_VERSION.$GO_OS-$GO_ARCH.tar.gz
sudo tar -C /usr/local -xzvf go$GO_VERSION.$GO_OS-$GO_ARCH.tar.gz
sudo rm go$GO_VERSION.$GO_OS-$GO_ARCH.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/profile
- name: Install Singularity
run: |
cd ..
wget https://github.com/hpcng/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-${SINGULARITY_VERSION}.tar.gz
sudo tar -xzf singularity-${SINGULARITY_VERSION}.tar.gz
sudo rm singularity-${SINGULARITY_VERSION}.tar.gz
echo "Finished installing binaries"
export PATH=$PATH:/usr/local/go/bin
cd singularity
sudo ./mconfig --without-suid
sudo make -C ./builddir
sudo make -C ./builddir install
- name: Build sif container
run: |
ls /
ls
mkdir build
sudo singularity build build/container.sif scripts/singularity_build.def
- name: Login and Deploy Container
run: |

Check failure on line 76 in .github/workflows/tag_and_publish.yml

View workflow run for this annotation

GitHub Actions / Tag and publish

Invalid workflow file

The workflow is not valid. .github/workflows/tag_and_publish.yml (Line: 76, Col: 14): Unrecognized named-value: 'jobs'. Located at position 1 within expression: jobs.tag.outputs.new_version

Check failure on line 76 in .github/workflows/tag_and_publish.yml

View workflow run for this annotation

GitHub Actions / Tag and publish

Invalid workflow file

The workflow is not valid. .github/workflows/tag_and_publish.yml (Line: 76, Col: 14): Unrecognized named-value: 'jobs'. Located at position 1 within expression: jobs.tag.outputs.new_version
if [[ ! -n ${{ jobs.tag.outputs.new_version }} ]]; then
echo "Tag is empty" && exit 1
else
echo "Tag is not empty"
fi
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
singularity push build/container.sif oras://ghcr.io/${GITHUB_REPOSITORY}:${{ jobs.tag.outputs.new_version }}
singularity push build/container.sif oras://ghcr.io/${GITHUB_REPOSITORY}:latest