Skip to content

removing illegal jinja logic #5

removing illegal jinja logic

removing illegal jinja logic #5

Workflow file for this run

name: Generate EasyBuild .eb Files
on:
push:
branches: [main, develop, 'feature/**']
pull_request:
release:
types: [published]
workflow_dispatch:
jobs:
build-eb:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install jinja2 requests
- name: Determine version and checksum
id: vars
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
VERSION="${GITHUB_REF_NAME}"
else
VERSION=`git describe --tags`
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "checksum=UNKNOWN" >> $GITHUB_OUTPUT
- name: Generate .eb file
run: |
python easybuild/generate_eb.py \
--version "${{ steps.vars.outputs.version }}" \
--git-sha "${{ github.sha }}" \
--template-dir "${PWD}/easybuild/templates" \
--output-dir "${PWD}/easybuild/generated"
- name: Validate generated .eb
run: |
python -m pip install --upgrade easybuild
eb easybuild/generated/uda-${{ steps.vars.outputs.version }}.eb --robot --dry-run
- name: Upload .eb artifact
uses: actions/upload-artifact@v4
with:
name: easybuild-eb-${{ steps.vars.outputs.version }}
path: easybuild/generated/*.eb
release-eb:
runs-on: ubuntu-latest
needs: build-eb
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download .eb artifact
uses: actions/download-artifact@v4
with:
path: easybuild/generated
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: easybuild/generated/*.eb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}