Skip to content

Commit

Permalink
Fix version bug and add cleanup variable (#2)
Browse files Browse the repository at this point in the history
* Update action.yaml
* Fix bug with version - was finding version in .git directory
- add cleanup block and variable (defaults to true)
  • Loading branch information
vsoch committed Dec 8, 2022
1 parent a935a9c commit 43acd36
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The action has the following variables:
|------|-------------|----------|---------|
|singularity-version | release version of [sylabs/singularity](https://github.com/sylabs/singularity/releases/) to install | false | 3.10.4 |
|go-version | version or range to provide to [actions/setup-go](https://github.com/actions/setup-go) | false | '>=1.17.0' |
|cleanup| cleanup archive extracted to /tmp | false | true |

And you can use as follows:

Expand Down Expand Up @@ -43,6 +44,3 @@ jobs:
```

See the [action.yaml](action.yaml) for details.

**Note** that `singularity version` is currently outputting a hash, and it's unclear if this is a bug. I will
update it when I learn more (if there is a fix).
20 changes: 18 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: version (or expression, e.g., >=1.17.0) of Go to install
default: '>=1.17.0'
required: true
cleanup:
description: cleanup singularity directory in /tmp
default: true
required: true

runs:
using: "composite"
Expand All @@ -35,13 +39,25 @@ runs:
env:
VERSION: ${{ inputs.singularity-version }}
run: |
# Build under isolated repository so we dont grab git version
cd /tmp
wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-ce-${VERSION}.tar.gz && \
tar -xzf singularity-ce-${VERSION}.tar.gz && \
rm singularity-ce-${VERSION}.tar.gz && \
cd singularity-ce-${VERSION} && \
./mconfig && \
make -C builddir && \
sudo make -C builddir install
sudo make -C builddir install
- name: Cleanup
if: (inputs.cleanup == true || inputs.cleanup == 'true')
shell: bash
env:
VERSION: ${{ inputs.singularity-version }}
run: rm -rf /tmp/singularity-ce-${VERSION}

- name: Show version
shell: bash
run: singularity version
run: |
which singularity
singularity version

0 comments on commit 43acd36

Please sign in to comment.