-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 3.25 KB
/
release.yml
File metadata and controls
107 lines (94 loc) · 3.25 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: release-binaries
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
data_sep: ":"
pyinstaller_flags: "--windowed"
artifact_path: dist/BIDSAppRunner.dmg
artifact_name: BIDSAppRunner-macos
- os: windows-latest
data_sep: ";"
pyinstaller_flags: "--onefile --windowed"
artifact_path: dist/BIDSAppRunner.zip
artifact_name: BIDSAppRunner-windows
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build binary
shell: bash
run: |
python -c "import os; os.makedirs('static', exist_ok=True); os.makedirs('templates', exist_ok=True)"
python -m PyInstaller app_gui.py \
--name BIDSAppRunner \
--clean \
--noconfirm \
${{ matrix.pyinstaller_flags }} \
--add-data "templates${{ matrix.data_sep }}templates" \
--add-data "static${{ matrix.data_sep }}static" \
--add-data "run_bids_apps.py${{ matrix.data_sep }}." \
--add-data "run_bids_apps_hpc.py${{ matrix.data_sep }}." \
--add-data "bids_validation_integration.py${{ matrix.data_sep }}." \
--add-data "check_app_output.py${{ matrix.data_sep }}." \
--add-data "check_system_deps.py${{ matrix.data_sep }}." \
--add-data "version.py${{ matrix.data_sep }}." \
--collect-all flask \
--collect-all waitress \
--hidden-import engineio.async_drivers.threading
- name: Package artifact (macOS)
if: matrix.os == 'macos-latest'
run: |
hdiutil create -volname "BIDSAppRunner" -srcfolder "dist/BIDSAppRunner.app" -ov -format UDZO "dist/BIDSAppRunner.dmg"
- name: Package artifact (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Compress-Archive -Path dist/BIDSAppRunner.exe -DestinationPath dist/BIDSAppRunner.zip -Force
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}-${{ github.ref_name }}
path: ${{ matrix.artifact_path }}
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: BIDSAppRunner-*
merge-multiple: true
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--generate-notes \
artifacts/*