diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 08bf64a..03da2ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,13 +9,8 @@ on: tags: - 'v[0-9]+.[0-9]+.[0-9]+*' -defaults: - run: - shell: bash - env: PACKAGE_NAME: labscript - SCM_VERSION_SCHEME: release-branch-semver SCM_LOCAL_SCHEME: no-local-version ANACONDA_USER: labscript-suite @@ -42,26 +37,30 @@ jobs: strategy: matrix: include: - - { os: ubuntu-latest, python: 3.8, arch: x64 } - # - { os: ubuntu-latest, python: 3.7, arch: x64 } - # - { os: ubuntu-latest, python: 3.6, arch: x64 } - - # - { os: macos-latest, python: 3.8, arch: x64 } - # - { os: macos-latest, python: 3.7, arch: x64 } - # - { os: macos-latest, python: 3.6, arch: x64 } - - # - { os: windows-latest, python: 3.8, arch: x64 } - # - { os: windows-latest, python: 3.7, arch: x64 } - # - { os: windows-latest, python: 3.6, arch: x64 } - - # - { os: windows-latest, python: 3.8, arch: x86 } - # - { os: windows-latest, python: 3.7, arch: x86 } - # - { os: windows-latest, python: 3.6, arch: x86 } + # - { os: ubuntu-latest, python: '3.10', arch: x64 } + # - { os: ubuntu-latest, python: '3.9', arch: x64 } + - { os: ubuntu-latest, python: '3.8', arch: x64 } + # - { os: ubuntu-latest, python: '3.7', arch: x64 } + + # - { os: macos-latest, python: '3.10', arch: x64 } + # - { os: macos-latest, python: '3.9', arch: x64 } + # - { os: macos-latest, python: '3.8', arch: x64 } + # - { os: macos-latest, python: '3.7', arch: x64 } + + # - { os: windows-latest, python: '3.10', arch: x64 } + # - { os: windows-latest, python: '3.9', arch: x64 } + # - { os: windows-latest, python: '3.8', arch: x64 } + # - { os: windows-latest, python: '3.7', arch: x64 } + + # - { os: windows-latest, python: '3.10', arch: x86 } + # - { os: windows-latest, python: '3.9', arch: x86 } + # - { os: windows-latest, python: '3.8', arch: x86 } + # - { os: windows-latest, python: '3.7', arch: x86 } if: github.repository == 'labscript-suite/labscript' && (github.event_name != 'create' || github.event.ref_type != 'branch') steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -70,7 +69,7 @@ jobs: run: git tag -d $(git tag --points-at HEAD) - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} architecture: ${{ matrix.arch }} @@ -78,72 +77,66 @@ jobs: - name: Source Distribution if: strategy.job-index == 0 run: | - python -m pip install --upgrade pip setuptools wheel pep517 - python -m pep517.build -s . + python -m pip install --upgrade pip setuptools wheel build + python -m build -s . - name: Wheel Distribution # Impure Linux wheels are built in the manylinux job. if: (env.PURE == 'true' && strategy.job-index == 0) || (env.PURE == 'false' && runner.os != 'Linux') run: | - python -m pip install --upgrade pip setuptools wheel pep517 - python -m pep517.build -b . + python -m pip install --upgrade pip setuptools wheel build + python -m build -w . - name: Upload Artifact if: strategy.job-index == 0 || (env.PURE == 'false' && runner.os != 'Linux') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: dist path: ./dist - name: Set Variables for Conda Build + shell: bash run: | - if [ $RUNNER_OS == Windows ] && [ ${{ matrix.arch }} == x64 ]; then - CONDA_INSTALLER=Miniconda3-latest-Windows-x86_64.exe - elif [ $RUNNER_OS == Windows ]; then - CONDA_INSTALLER=Miniconda3-latest-Windows-x86.exe - elif [ $RUNNER_OS == Linux ]; then - CONDA_INSTALLER=Miniconda3-latest-Linux-x86_64.sh - else - CONDA_INSTALLER=Miniconda3-latest-MacOSX-x86_64.sh - fi if [ $NOARCH == true ]; then CONDA_BUILD_ARGS="--noarch" else CONDA_BUILD_ARGS="" fi - echo "CONDA_INSTALLER=$CONDA_INSTALLER" >> $GITHUB_ENV echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_ENV + - name: Install Miniconda + # We need https://github.com/conda-incubator/setup-miniconda/pull/189 in order + # to be able to install 32-bit miniconda on Windows. Once setup-miniconda 2.1.2 + # is released with this fix, can change to @v2. + uses: conda-incubator/setup-miniconda@1a875d105ac03256664b54c882c8c374ce617ef6 + with: + auto-update-conda: true + python-version: ${{ matrix.python }} + architecture: ${{ matrix.arch }} + miniconda-version: "latest" + + - name: Workaround conda-build incompatibility with xcode >12 + if: runner.os == 'macOS' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: 11.7 + - name: Conda package (Unix) if: runner.os != 'Windows' + shell: bash -l {0} run: | - curl -LO https://repo.continuum.io/miniconda/$CONDA_INSTALLER - bash "$CONDA_INSTALLER" -b -p .miniconda - source .miniconda/etc/profile.d/conda.sh - conda activate - conda update -n base -c defaults conda - conda create -n py${{ matrix.python }} python=${{ matrix.python }} - conda activate py${{ matrix.python }} - conda install -c cbillington setuptools-conda - pip install --upgrade setuptools_scm + conda install -c labscript-suite setuptools-conda setuptools-conda build $CONDA_BUILD_ARGS . - name: Conda Package (Windows) if: runner.os == 'Windows' - shell: cmd + shell: cmd /C CALL {0} run: | - curl -LO https://repo.continuum.io/miniconda/%CONDA_INSTALLER% - %CONDA_INSTALLER% /S /D=%CD%\.miniconda && ^ - .miniconda\Scripts\activate && ^ - conda update -n base -c defaults conda && ^ - conda create -n py${{ matrix.python }} python=${{ matrix.python }} && ^ - conda activate py${{ matrix.python }} && ^ - conda install -c cbillington setuptools-conda && ^ - pip install --upgrade setuptools_scm && ^ - setuptools-conda build %CONDA_BUILD_ARGS% . + conda install -c labscript-suite setuptools-conda && ^ + setuptools-conda build %CONDA_BUILD_ARGS% --croot ${{ runner.temp }}\cb . - name: Upload Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: conda_packages path: ./conda_packages @@ -152,16 +145,11 @@ jobs: manylinux: name: Build Manylinux runs-on: ubuntu-latest - strategy: - matrix: - include: - - { python: 'cp36-cp36m cp37-cp37m cp38-cp38' } - if: github.repository == 'labscript-suite/labscript' && (github.event_name != 'create' || github.event.ref_type != 'branch') steps: - name: Checkout if: env.PURE == 'false' - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -171,16 +159,17 @@ jobs: - name: Build Manylinux Wheels if: env.PURE == 'false' - uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64 + uses: RalfG/python-wheels-manylinux-build@v0.4.2 with: - python-versions: ${{ matrix.python }} + python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' + pre-build-command: 'git config --global --add safe.directory "*"' - name: Upload Artifact if: env.PURE == 'false' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: dist - path: wheelhouse/*manylinux*.whl + path: dist/*manylinux*.whl release: name: Release @@ -189,19 +178,19 @@ jobs: steps: - name: Download Artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: dist path: ./dist - name: Download Artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: conda_packages path: ./conda_packages - name: Publish on TestPyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.testpypi }} @@ -243,19 +232,19 @@ jobs: user: __token__ password: ${{ secrets.pypi }} - - name: Install Miniconda and cloud client - run: | - curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - bash Miniconda3-latest-Linux-x86_64.sh -b -p .miniconda - source .miniconda/etc/profile.d/conda.sh - conda activate - conda install anaconda-client + - name: Install Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + + - name: Install Anaconda cloud client + shell: bash -l {0} + run: conda install anaconda-client - name: Publish to Anaconda test label if: github.event.ref_type != 'tag' + shell: bash -l {0} run: | - source .miniconda/etc/profile.d/conda.sh - conda activate anaconda \ --token ${{ secrets.ANACONDA_API_TOKEN }} \ upload \ @@ -264,10 +253,9 @@ jobs: conda_packages/*/* - name: Publish to Anaconda main label + shell: bash -l {0} if: github.event.ref_type == 'tag' run: | - source .miniconda/etc/profile.d/conda.sh - conda activate anaconda \ --token ${{ secrets.ANACONDA_API_TOKEN }} \ upload \