Skip to content

Commit

Permalink
⚗️ conda env upload to google storage
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed Jun 22, 2024
1 parent a9ad805 commit 6614a1b
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions .github/workflows/conda-pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,72 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10"]
runs-on: ${{ matrix.os }}

steps:
- name: Set up variables
id: vars
shell: bash -el {0}
run: |
echo "FILENAME=wake-${{ runner.os }}-${{ runner.arch }}.tar.gz" >> $GITHUB_ENV
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: wake
auto-update-conda: true
python-version: "3.10"
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: |
echo "OS=$(echo ${{ runner.os }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "ARCH=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "FILENAME=wake-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz" >> $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: Upload files
uses: actions/upload-artifact@v2
- 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-venv'
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 metafiles
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
name: wake-${{ runner.os }}-${{ runner.arch }}
path: |
${{ env.FILENAME }}
${{ env.FILENAME }}.sha256
${{ env.FILENAME }}.sha256.sig

0 comments on commit 6614a1b

Please sign in to comment.