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 45157a0
Showing 1 changed file with 46 additions and 13 deletions.
59 changes: 46 additions & 13 deletions .github/workflows/conda-pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,79 @@ 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: |
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: 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 checksum
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: ${{ env.FILENAME }}.sha256
destination: 'wake-venv'

- name: Upload signature
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
path: ${{ env.FILENAME }}.sha256.sig
destination: 'wake-venv'

0 comments on commit 45157a0

Please sign in to comment.