Skip to content

Build native conda environments #40

Build native conda environments

Build native conda environments #40

Workflow file for this run

name: Build native conda environments
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: wake
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install .
echo "VERSION=$(wake --version)" >> $GITHUB_ENV
conda install -c conda-forge conda-pack -y
- name: Set up variables
id: vars
shell: bash -el {0}
run: |
OS=$(echo ${{ runner.os }} | tr '[:upper:]' '[:lower:]')
ARCH=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')
echo "FILENAME=wake-${{ env.VERSION }}-${OS}-${ARCH}.tar.gz" >> $GITHUB_ENV
echo "OS=${OS}" >> $GITHUB_ENV
echo "ARCH=${ARCH}" >> $GITHUB_ENV
- name: Pack conda environment
shell: bash -el {0}
run: |
conda-pack -n wake -o ${{ env.FILENAME }}
- name: Generate checksum Linux & Windows
if: runner.os != 'macOS'
run: |
sha256sum ${{ env.FILENAME }} > ${{ env.FILENAME }}.sha256
- name: Generate checksum MacOS
if: runner.os == 'macOS'
run: |
shasum -a 256 ${{ env.FILENAME }} > ${{ env.FILENAME }}.sha256
- name: Generate signature
run: |
echo "${{ secrets.CONDA_PRIVATE_KEY }}" > key.pem
openssl dgst -sha256 -sign key.pem -out ${{ env.FILENAME }}.sha256.sig ${{ env.FILENAME }}.sha256
- name: Auth to Google Storage
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Upload tarball
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: '${{ env.FILENAME }}'
destination: 'wake-conda'
headers: |-
x-goog-meta-version: ${{ env.VERSION }}
x-goog-meta-os: ${{ env.OS }}
x-goog-meta-arch: ${{ env.ARCH }}
x-goog-meta-python: ${{ matrix.python-version }}
- name: Upload checksum
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: ${{ env.FILENAME }}.sha256
destination: 'wake-conda'
- name: Upload signature
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: ${{ env.FILENAME }}.sha256.sig
destination: 'wake-conda'