mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-05 14:54:37 +08:00
80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
name: Make single-file installers (manual dispatch)
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash -leo pipefail {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@v4
|
|
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: Install constructor environment with Micromamba
|
|
uses: mamba-org/setup-micromamba@v2
|
|
with:
|
|
environment-name: installer
|
|
create-args: >-
|
|
python=3.11
|
|
jinja2
|
|
constructor
|
|
init-shell: bash
|
|
|
|
- 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
|
|
# Copy for "latest" release by removing version
|
|
# Inspired by https://github.com/conda-forge/miniforge/blob/main/.github/workflows/ci.yml
|
|
cp ${{ steps.file-name.outputs.FILE_NAME }} $(echo ${{ steps.file-name.outputs.FILE_NAME }} | sed -e 's/-[^-]*//')
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ steps.file-name.outputs.FILE_NAME }}
|
|
path: OpenFEforge*
|
|
if-no-files-found: error
|
|
|
|
- name: Upload openfe forge to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: OpenFEforge*
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
file_glob: true
|
|
if: startsWith(github.ref, 'refs/tags/')
|