|
| 1 | +name: packages |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - 'v[0-9]+.[0-9]+.[0-9]+' |
| 6 | + - 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' |
| 7 | + - 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+' |
| 8 | + - 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+' |
| 9 | + |
| 10 | +jobs: |
| 11 | + conda_build: |
| 12 | + name: Build Conda Packages |
| 13 | + runs-on: 'ubuntu-latest' |
| 14 | + defaults: |
| 15 | + run: |
| 16 | + shell: bash -l {0} |
| 17 | + env: |
| 18 | + PKG_TEST_PYTHON: "--test-python=py37" |
| 19 | + PKG_TEST_GROUP: "--test-group=all" |
| 20 | + PYCTDEV_ECOSYSTEM: "conda" |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + - name: Fetch unshallow |
| 24 | + run: git fetch --prune --tags --unshallow -f |
| 25 | + - uses: actions/setup-python@v2 |
| 26 | + with: |
| 27 | + python-version: ${{ matrix.python-version }} |
| 28 | + - uses: conda-incubator/setup-miniconda@v2 |
| 29 | + with: |
| 30 | + miniconda-version: "latest" |
| 31 | + python-version: 3.8 |
| 32 | + - name: Set output |
| 33 | + id: vars |
| 34 | + run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} |
| 35 | + - name: conda setup |
| 36 | + run: | |
| 37 | + conda config --set always_yes True |
| 38 | + conda deactivate |
| 39 | + pip install -e . |
| 40 | + conda install pip |
| 41 | + doit ecosystem_setup |
| 42 | + doit package_build --no-pkg-tests |
| 43 | + pip uninstall -y doit pyctdev |
| 44 | + rm -f .doit.db |
| 45 | + conda install -y --use-local pyctdev |
| 46 | + - name: conda build |
| 47 | + run: | |
| 48 | + eval "$(conda shell.bash hook)" |
| 49 | + doit package_build $PKG_TEST_PYTHON $PKG_TEST_GROUP |
| 50 | + - name: conda dev upload |
| 51 | + if: (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')) |
| 52 | + run: | |
| 53 | + eval "$(conda shell.bash hook)" |
| 54 | + doit package_upload --token=${{ secrets.CONDA_UPLOAD_TOKEN }} --label=dev |
| 55 | + - name: conda main upload |
| 56 | + if: (!(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) |
| 57 | + run: | |
| 58 | + eval "$(conda shell.bash hook)" |
| 59 | + doit package_upload --token=${{ secrets.CONDA_UPLOAD_TOKEN }} --label=dev --label=main |
| 60 | + pip_build: |
| 61 | + name: Build PyPI Packages |
| 62 | + runs-on: 'ubuntu-latest' |
| 63 | + defaults: |
| 64 | + run: |
| 65 | + shell: bash -l {0} |
| 66 | + env: |
| 67 | + PKG_TEST_GROUP: "--test-group=all" |
| 68 | + PYPI: "https://upload.pypi.org/legacy/" |
| 69 | + PIP_FORMATS: "sdist bdist_wheel" |
| 70 | + PYCTDEV_ECOSYSTEM: "pip" |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v2 |
| 73 | + - name: Fetch unshallow |
| 74 | + run: git fetch --prune --tags --unshallow -f |
| 75 | + - uses: actions/setup-python@v2 |
| 76 | + with: |
| 77 | + python-version: ${{ matrix.python-version }} |
| 78 | + - uses: conda-incubator/setup-miniconda@v2 |
| 79 | + with: |
| 80 | + miniconda-version: "latest" |
| 81 | + python-version: 3.8 |
| 82 | + - name: conda setup |
| 83 | + run: | |
| 84 | + conda config --set always_yes True |
| 85 | + pip install -e . |
| 86 | + doit ecosystem_setup |
| 87 | + - name: pip build |
| 88 | + run: doit package_build $PKG_TEST_GROUP --formats="$PIP_FORMATS" --sdist-run-tests |
| 89 | + - name: pip upload |
| 90 | + run: doit ecosystem=pip package_upload -u ${{ secrets.PPU }} -p ${{ secrets.PPP }} -r $PYPI |
0 commit comments