1- name : Build Singularity Images
1+ name : Build Apptainer Images
22
33on :
44 workflow_run :
77 - completed
88
99jobs :
10- build-singularity :
10+ build-apptainer :
1111 runs-on : ubuntu-latest
1212 strategy :
1313 matrix :
1414 base :
1515 - {image: 'ghcr.io/bioconductor/r-ver', outname: 'r-ver'}
1616 - {image: 'ghcr.io/bioconductor/bioconductor', outname: 'bioconductor'}
1717 - {image: 'ghcr.io/bioconductor/tidyverse', outname: 'tidyverse'}
18- - {image: 'ghcr.io/bioconductor/cuda', outname: 'cuda'}
19- - {image: 'ghcr.io/bioconductor/ml', outname: 'ml'}
20- - {image: 'ghcr.io/bioconductor/ml-verse', outname: 'ml-verse'}
2118 - {image: 'ghcr.io/bioconductor/shiny', outname: 'shiny'}
2219 steps :
2320 - name : Checkout code
2421 uses : actions/checkout@v4
2522
26- - name : Setup Singularity deps
23+ - name : Install Apptainer dependencies
2724 run : |
2825 sudo apt-get update
2926 sudo apt-get install -y \
@@ -50,18 +47,18 @@ jobs:
5047 with :
5148 go-version : 1.24.1
5249
53- - name : Setup Singularity
50+ - name : Install Apptainer
5451 run : |
55- export VERSION=4 .3.0 && # adjust this as necessary \
56- wget https://github.com/sylabs/singularity /releases/download/v${VERSION}/singularity-ce- ${VERSION}.tar.gz && \
57- tar -xzf singularity-ce- ${VERSION}.tar.gz && \
58- cd singularity-ce -${VERSION}
59- ./mconfig && \
60- make -C ./builddir && \
52+ export VERSION=1 .3.6 # Latest Apptainer version as of 2025-04
53+ wget https://github.com/apptainer/apptainer /releases/download/v${VERSION}/apptainer- ${VERSION}.tar.gz
54+ tar -xzf apptainer- ${VERSION}.tar.gz
55+ cd apptainer -${VERSION}
56+ ./mconfig
57+ make -C ./builddir
6158 sudo make -C ./builddir install
62-
63- - name : Singularity build config
64- run : singularity buildcfg
59+
60+ - name : Verify Apptainer config
61+ run : apptainer buildcfg
6562
6663 - name : Get branch name
6764 id : vars
@@ -78,14 +75,14 @@ jobs:
7875 echo "origbranch=$BRANCH_NAME" >> $GITHUB_OUTPUT
7976 echo "procbranch=$PROCESSED_NAME" >> $GITHUB_OUTPUT
8077
81- - name : Build Singularity Image
78+ - name : Build Apptainer Image
8279 run : |
83- singularity build --fakeroot \
80+ apptainer build \
8481 "${{matrix.base.outname}}-$(date +%s).sif" \
8582 docker://${{ matrix.base.image }}:${{steps.vars.origbranch}}
8683
8784 - name : Push to GitHub Packages
8885 run : |
89- echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
90- singularity push *.sif oras://ghcr.io/${{github.repository_owner}}/${{matrix.base.outname}}:${{steps.vars.origbranch}}
91- singularity push *.sif oras://ghcr.io/${{github.repository_owner}}/${{matrix.base.outname}}:${{steps.vars.procbranch}}
86+ echo ${{ secrets.GITHUB_TOKEN }} | apptainer remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
87+ apptainer push *.sif oras://ghcr.io/${{github.repository_owner}}/${{matrix.base.outname}}:${{steps.vars.origbranch}}
88+ apptainer push *.sif oras://ghcr.io/${{github.repository_owner}}/${{matrix.base.outname}}:${{steps.vars.procbranch}}
0 commit comments