bump version to 0.6.0 #6
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: apptainer-release | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
release: | |
name: Create release | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get latest tag | |
run: | | |
# Get the latest tag, we won't build if it's the current | |
git fetch --tags | |
latest_tag=$(git tag | tail -1) | |
echo "latest_tag=$latest_tag" >> $GITHUB_ENV | |
- name: Define repository name and release version | |
run: | | |
release=$(cat VERSION) | |
echo "release_tag=$release" >> $GITHUB_ENV | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
if: ${{ env.release_tag != env.latest_tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.release_tag }} | |
release_name: Release ${{ env.release_tag }} | |
draft: false | |
prerelease: false | |
- uses: eWaterCycle/setup-apptainer@v2 | |
if: ${{ env.release_tag != env.latest_tag }} | |
with: | |
apptainer-version: 1.1.2 | |
- name: Build the container(s) | |
if: ${{ env.release_tag != env.latest_tag }} | |
run: | | |
for definition_file in $(ls *.def); do | |
filename_no_suffix=$(basename ${definition_file} .def) | |
apptainer build ${filename_no_suffix}.sif ${definition_file} | |
done | |
- name: Upload release assets | |
if: ${{ env.release_tag != env.latest_tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
tag_name: ${{ env.release_tag }} | |
run: | | |
sudo apt-get update && sudo apt-get install -y hub | |
hub release edit $(find . -type f -name "*.sif" -printf "-a %p ") -m "" "$tag_name" |