Merge pull request #8 from IntelPython/dependabot/github_actions/acti… #17
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
name: Conda package | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: read-all | |
env: | |
PACKAGE_NAME: intel-gpu-ocl-icd-system | |
jobs: | |
build_and_test_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set pkgs_dirs | |
run: | | |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc | |
- name: Add conda to system path | |
run: echo $CONDA/bin >> $GITHUB_PATH | |
- name: Install conda-build | |
run: conda install conda-build -c conda-forge --override-channels | |
- name: Build conda package | |
run: | | |
# use bootstrap channel to pull NumPy linked with OpenBLAS | |
CHANNELS="-c conda-forge --override-channels" | |
conda build \ | |
$CHANNELS \ | |
recipe | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} | |
path: /usr/share/miniconda/conda-bld/noarch/${{ env.PACKAGE_NAME }}-*.tar.bz2 | |
upload_linux: | |
needs: build_and_test_linux | |
if: ${{github.ref == 'refs/heads/main' || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download conda artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} | |
- name: Install anaconda-client | |
run: conda install anaconda-client -c conda-forge --override-channels | |
- name: Add conda to system path | |
run: echo $CONDA/bin >> $GITHUB_PATH | |
- name: Package version | |
run: echo "PACKAGE_VERSION=$(basename ${{ env.PACKAGE_NAME }}-*.tar.bz2 | sed 's/^${{ env.PACKAGE_NAME }}-\([^-]*\).*/\1/')" >> $GITHUB_ENV | |
- name: Upload | |
env: | |
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
run: | | |
anaconda --token $ANACONDA_TOKEN upload --user dppy --label dev ${PACKAGE_NAME}-*.tar.bz2 | |