diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03da2ba..2ec8de1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,25 +37,29 @@ jobs: strategy: matrix: include: - # - { 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 } + - { os: ubuntu-latest, python: '3.11', arch: x64, conda: true} + # - { os: ubuntu-latest, python: '3.10', arch: x64, conda: true } + # - { os: ubuntu-latest, python: '3.9', arch: x64, conda: true } + # - { os: ubuntu-latest, python: '3.8', arch: x64, conda: true } + # - { os: ubuntu-latest, python: '3.7', arch: x64, conda: true } + + # - { os: macos-11, python: '3.11', arch: x64, conda: true } + # - { os: macos-11, python: '3.10', arch: x64, conda: true } + # - { os: macos-11, python: '3.9', arch: x64, conda: true } + # - { os: macos-11, python: '3.8', arch: x64, conda: true } + # - { os: macos-11, python: '3.7', arch: x64, conda: true } + + # - { os: windows-latest, python: '3.11', arch: x64, conda: true } + # - { os: windows-latest, python: '3.10', arch: x64, conda: true } + # - { os: windows-latest, python: '3.9', arch: x64, conda: true } + # - { os: windows-latest, python: '3.8', arch: x64, conda: true } + # - { os: windows-latest, python: '3.7', arch: x64, conda: true } + + # - { os: windows-latest, python: '3.11', arch: x86, conda: false } # conda not yet available + # - { os: windows-latest, python: '3.10', arch: x86, conda: true } + # - { os: windows-latest, python: '3.9', arch: x86, conda: true } + # - { os: windows-latest, python: '3.8', arch: x86, conda: true } + # - { os: windows-latest, python: '3.7', arch: x86, conda: true } if: github.repository == 'labscript-suite/labscript' && (github.event_name != 'create' || github.event.ref_type != 'branch') steps: @@ -95,6 +99,7 @@ jobs: path: ./dist - name: Set Variables for Conda Build + if: matrix.conda shell: bash run: | if [ $NOARCH == true ]; then @@ -105,37 +110,36 @@ jobs: 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 + if: matrix.conda + uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true python-version: ${{ matrix.python }} architecture: ${{ matrix.arch }} miniconda-version: "latest" - - name: Workaround conda-build incompatibility with xcode >12 + - 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' + if: (matrix.conda && runner.os != 'Windows') shell: bash -l {0} run: | conda install -c labscript-suite setuptools-conda setuptools-conda build $CONDA_BUILD_ARGS . - name: Conda Package (Windows) - if: runner.os == 'Windows' + if: (matrix.conda && runner.os == 'Windows') shell: cmd /C CALL {0} run: | conda install -c labscript-suite setuptools-conda && ^ setuptools-conda build %CONDA_BUILD_ARGS% --croot ${{ runner.temp }}\cb . - name: Upload Artifact + if: matrix.conda uses: actions/upload-artifact@v3 with: name: conda_packages @@ -161,7 +165,7 @@ jobs: if: env.PURE == 'false' uses: RalfG/python-wheels-manylinux-build@v0.4.2 with: - python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' + python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311' pre-build-command: 'git config --global --add safe.directory "*"' - name: Upload Artifact @@ -189,45 +193,34 @@ jobs: name: conda_packages path: ./conda_packages - - name: Publish on TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.testpypi }} - repository_url: https://test.pypi.org/legacy/ - - name: Get Version Number if: github.event.ref_type == 'tag' run: | VERSION="${GITHUB_REF/refs\/tags\/v/}" echo "VERSION=$VERSION" >> $GITHUB_ENV - - name: Create GitHub Release + - name: Create GitHub Release and Upload Release Asset if: github.event.ref_type == 'tag' - id: create_release - uses: actions/create-release@latest + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.event.ref }} - release_name: ${{ env.PACKAGE_NAME }} ${{ env.VERSION }} + name: ${{ env.PACKAGE_NAME }} ${{ env.VERSION }} draft: true prerelease: ${{ contains(github.event.ref, 'rc') }} + files: ./dist/${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz - - name: Upload Release Asset - if: github.event.ref_type == 'tag' - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish on TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz - asset_name: ${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz - asset_content_type: application/gzip + user: __token__ + password: ${{ secrets.testpypi }} + repository-url: https://test.pypi.org/legacy/ - name: Publish on PyPI if: github.event.ref_type == 'tag' - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.pypi }}