Whoops #185
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: create-release | |
on: | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | |
required: false | |
default: false | |
push: | |
branches: [ master ] | |
tags: | |
- "*" | |
jobs: | |
build: | |
name: build | |
runs-on: ${{ matrix.os }} | |
steps: | |
- if: ${{ matrix.os == 'windows-latest' }} | |
uses: actions/cache@v3 | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- if: ${{ matrix.os == 'macos-13' }} | |
uses: actions/cache@v3 | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
architecture: x64 | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "11.0.20+8" # The JDK version to make available on the path. | |
java-package: jdk | |
architecture: x64 | |
- run: | | |
pip install --upgrade pip setuptools wheel | |
pip install numpy==1.23.1 matplotlib==3.1.3 | |
pip install pyinstaller | |
# this is a separate step because we need to set the CPPFLAGS and LDFLAGS env variables *after* installing mysql, in the next step | |
- if: ${{ matrix.os == 'macos-13' }} | |
run: | | |
brew install mysql@8.0 | |
# needed for mysql@8.0 | |
# must be run PRIOR to the step its accessed | |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path | |
echo "/usr/local/opt/mysql@8.0/bin" >> $GITHUB_PATH | |
- env: | |
LDFLAGS: "-L/usr/local/opt/mysql@8.0/lib -L/usr/local/opt/openssl/lib" | |
CERTIFICATE_OSX_APPLICATION: ${{ secrets.BUILD_CERTIFICATE_BASE64_CIMINI }} | |
CERTIFICATE_PASSWORD: ${{ secrets.P12_PASSWORD_CIMINI }} | |
# needed for mysql@8.0 | |
CPPFLAGS: -I/usr/local/opt/mysql@8.0/include | |
PKG_CONFIG_PATH: /usr/local/opt/mysql@8.0/lib/pkgconfig | |
if: ${{ matrix.os == 'macos-13' }} | |
run: | | |
sed -i '' 's/4.0.0/3.0.4.1/' Info.plist | |
make | |
chmod +x add-osx-certificate.sh && ./add-osx-certificate.sh | |
echo "Finished add-osx-certificate" | |
working-directory: ./distribution/macos | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
- env: | |
LDFLAGS: "-L/usr/local/opt/mysql@8.0/lib -L/usr/local/opt/openssl/lib" | |
CERTIFICATE_OSX_APPLICATION: ${{ secrets.BUILD_CERTIFICATE_BASE64_CIMINI }} | |
CERTIFICATE_PASSWORD: ${{ secrets.P12_PASSWORD_CIMINI }} | |
# needed for mysql@8.0 | |
CPPFLAGS: -I/usr/local/opt/mysql@8.0/include | |
PKG_CONFIG_PATH: /usr/local/opt/mysql@8.0/lib/pkgconfig | |
if: ${{ matrix.os == 'macos-13' }} | |
run: | | |
chmod +x osx-codesign.sh && ./osx-codesign.sh | |
ditto -ck --keepParent --rsrc --sequesterRsrc ./dist/CellProfiler-Analyst.app ./dist/CellProfiler-Analyst-macOS-3.0.4.1.zip | |
working-directory: ./distribution/macos | |
- env: | |
JDK_HOME: C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.20-8\x64 | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
pip install cython | |
pip install --editable . | |
- if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
pyinstaller distribution/windows/CellProfiler-Analyst.spec | |
iscc /dMyAppVersion="3.0.4.1" "distribution/windows/CellProfiler-Analyst.iss" | |
- if: ${{ matrix.os == 'macos-13' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CellProfiler-Analyst-macOS-3.0.4.1.zip | |
path: ./distribution/macos/dist/CellProfiler-Analyst-macOS-3.0.4.1.zip | |
- if: ${{ matrix.os == 'windows-latest' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CellProfiler-Analyst-Windows-3.0.4.1.exe | |
path: ./distribution/windows/Output/CellProfiler-Analyst-Windows-3.0.4.1.exe | |
strategy: | |
matrix: | |
os: [macos-13, windows-latest] | |
python-version: [ "3.8" ] | |
upload: | |
name: upload | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
draft: true | |
prerelease: true | |
release_name: ${{ github.ref }} | |
tag_name: ${{ github.ref }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: CellProfiler-Analyst-macOS-3.0.4.1.zip | |
path: ./ | |
- uses: actions/download-artifact@v4 | |
with: | |
name: CellProfiler-Analyst-Windows-3.0.4.1.exe | |
path: ./ | |
- env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: actions/upload-release-asset@v1 | |
with: | |
asset_content_type: application/zip | |
asset_name: CellProfiler-Analyst-macOS-3.0.4.1.zip | |
asset_path: /home/runner/work/CellProfiler-Analyst/CellProfiler-Analyst/CellProfiler-Analyst-macOS-3.0.4.1.zip | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
- env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: actions/upload-release-asset@v1 | |
with: | |
asset_content_type: application/exe | |
asset_name: CellProfiler-Analyst-Windows-3.0.4.1.exe | |
asset_path: /home/runner/work/CellProfiler-Analyst/CellProfiler-Analyst/CellProfiler-Analyst-Windows-3.0.4.1.exe | |
upload_url: ${{ steps.create_release.outputs.upload_url }} |