-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build conda environments | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-arm-linux: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up variables | ||
id: vars | ||
shell: bash -el {0} | ||
run: | | ||
echo "FILENAME=wake-${{ runner.os }}-ARM64.tar.gz" >> $GITHUB_ENV | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64 | ||
|
||
- name: Run ARM environment in Docker | ||
run: | | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace --platform linux/arm64 \ | ||
condaforge/miniforge3 bash -c " | ||
conda create -n wake --platform linux-aarch64 python=3.10 -y && \ | ||
source activate wake && \ | ||
conda install -c conda-forge conda-pack -y && \ | ||
python -m pip install . && \ | ||
conda-pack -n wake -o ${{ env.FILENAME }} && \ | ||
sha256sum ${{ env.FILENAME }} > ${{ env.FILENAME }}.sha256 && \ | ||
echo '${{ secrets.CONDA_PRIVATE_KEY }}' > key.pem && \ | ||
openssl dgst -sha256 -sign key.pem -out ${{ env.FILENAME }}.sha256.sig ${{ env.FILENAME }}.sha256 | ||
" | ||
- name: Copy files back to workspace | ||
run: | | ||
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace --platform linux/arm64 \ | ||
condaforge/miniforge3 bash -c " | ||
cp ${{ env.FILENAME }} /workspace && \ | ||
cp ${{ env.FILENAME }}.sha256 /workspace && \ | ||
cp ${{ env.FILENAME }}.sha256.sig /workspace | ||
" | ||
- name: Adjust permissions | ||
run: sudo chmod -R 777 ${{ github.workspace }} | ||
|
||
- name: Upload files | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wake-${{ runner.os }}-ARM64 | ||
path: | | ||
${{ env.FILENAME }} | ||
${{ env.FILENAME }}.sha256 | ||
${{ env.FILENAME }}.sha256.sig |