-
Notifications
You must be signed in to change notification settings - Fork 40
79 lines (68 loc) · 2.42 KB
/
installer.yaml
File metadata and controls
79 lines (68 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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: |
REPO="${{ github.repository }}"
VERSION=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/$REPO/releases/latest" | jq -r '.tag_name | ltrimstr("v")')
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/')