add distributed #123
Workflow file for this run
This file contains 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 Binaries | |
on: | |
push: | |
branches: | |
- "main" | |
- "release/**" | |
- "pre-releases/**" | |
- "!release/v1" | |
pull_request: | |
branches: | |
- "main" | |
- "release/**" | |
- "!release/v1" | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-22.04, macos-13, ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: '1.5.6-0' | |
micromamba-binary-path: ${{ runner.temp }}/bin/micromamba | |
environment-file: conda_environment_binary.yaml | |
environment-name: copernicusmarine-binary | |
condarc-file: .condarc | |
cache-environment: true | |
post-cleanup: 'all' | |
- name: Build with PyInstaller | |
shell: micromamba-shell {0} | |
run: | | |
make run-using-pyinstaller-${{ matrix.os }} | |
- name: Set VERSION environment variable | |
id: set-version | |
shell: micromamba-shell {0} | |
run: echo "VERSION=$(poetry version --short)" >> $GITHUB_OUTPUT | |
- name: Upload binaries to macos or ubuntu | |
shell: micromamba-shell {0} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if [ "${{ matrix.os }}" == "macos-latest" ]; then | |
ARCH="macos-arm64.zip" | |
elif [ "${{ matrix.os }}" == "macos-13" ]; then | |
ARCH="macos-x86_64.zip" | |
elif [ "${{ matrix.os }}" == "ubuntu-22.04" ]; then | |
ARCH="linux-glibc-2.35.cli" | |
elif [ "${{ matrix.os }}" == "ubuntu-20.04" ]; then | |
ARCH="linux-glibc-2.31.cli" | |
fi | |
gh release upload v${{steps.set-version.outputs.VERSION}} dist/copernicusmarine_${ARCH}#copernicusmarine-binary-for-v${{steps.set-version.outputs.VERSION}}-${ARCH} |