Skip to content

Make single-file installers #42

Make single-file installers

Make single-file installers #42

Workflow file for this run

name: Make single-file installers
on:
workflow_dispatch:
defaults:
run:
shell: bash -l {0}
jobs:
test:
name: Building single file installer on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Latest Version
id: latest-version
run: |
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
# slice off the v, ie v0.7.2 -> 0.7.2
VERSION=${LATEST_TAG:1}
echo $VERSION
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Print Latest Version
run: echo ${{ steps.latest-version.outputs.VERSION }}
- name: Install constructor environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: false
channels: conda-forge
environment-name: constructor-env
extra-specs: |
python=3.10
jinja2
constructor
- name: Create installer
run: VERSION=${{ steps.latest-version.outputs.VERSION }} constructor devtools/installer/
- name: Get installer file name
id: file-name
run: |
# This should work as long as we don't have any *.sh files in our root dir
FILE_NAME=$(find * -maxdepth 0 -type f -name "*.sh")
echo $FILE_NAME
echo "FILE_NAME=$FILE_NAME" >> $GITHUB_OUTPUT
- name: Test installer
run: |
chmod +x ${{ steps.file-name.outputs.FILE_NAME }}
./${{ steps.file-name.outputs.FILE_NAME }} -b
export PATH="$HOME/openfeforge/bin:$PATH"
OFE_SLOW_TESTS=FALSE pytest -v --pyargs openfe pytest -v --pyargs openfe
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.file-name.outputs.FILE_NAME }}
path: OpenFEforge*
if-no-files-found: error