Skip to content

Commit

Permalink
separate arm and amd build;debug
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyinz committed May 15, 2024
1 parent 96ec131 commit 04b0577
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/conda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
branches: [ master ]

jobs:
conda-build-arm:
conda-build-arm64:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -30,7 +30,33 @@ jobs:
with:
context: .
file: scripts/Dockerfile_conda_build
platforms: linux/amd64,linux/arm64
platforms: linux/arm64
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
ANACONDA_API_TOKEN=${{ secrets.CONDA_TOKEN }}
conda-build-amd64:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v3

# Setup for Multi-platform image
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image arm64
uses: docker/build-push-action@v4
with:
context: .
file: scripts/Dockerfile_conda_build
platforms: linux/amd64
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
ANACONDA_API_TOKEN=${{ secrets.CONDA_TOKEN }}
Expand Down
9 changes: 6 additions & 3 deletions scripts/Dockerfile_conda_build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM continuumio/miniconda3:latest
COPY . /mspass
RUN mv /mspass /mspasspy_build
ADD . /mspass
ADD .git /mspass/.git
RUN mv /mspass /mspasspy_build && cd /mspasspy_build && git status

ARG PYTHON_VERSION
ARG TARGETARCH
Expand All @@ -20,5 +21,7 @@ RUN cd /mspasspy_build \
&& export CONDA_BUILD_DEBUG=1 \
&& PACKAGE_PATH=$(conda build . --python ${PYTHON_VERSION} --output) \
&& conda build . --python ${PYTHON_VERSION} --debug \
&& anaconda -t $ANACONDA_API_TOKEN upload $PACKAGE_PATH --label py${PYTHON_VERSION} --force
&& if [ "$PYTHON_VERSION" == "3.11" ]; then \
anaconda -t $ANACONDA_API_TOKEN upload $PACKAGE_PATH --label main --label py${PYTHON_VERSION} --force ; \
else anaconda -t $ANACONDA_API_TOKEN upload $PACKAGE_PATH --label py${PYTHON_VERSION} --force ; fi

0 comments on commit 04b0577

Please sign in to comment.