Skip to content

Disable attestations #11

Disable attestations

Disable attestations #11

---
# Inspired from:
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
name: Publish to PyPI and Anaconda
on:
push:
branches: [main, develop]
tags: '*'
jobs:
build-n-publish:
name: Publish to PyPI and Anaconda
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set version
run: echo "BW_FUNCTIONAL_VERSION=0.b.$(git rev-list 785f296..HEAD --count)" >> $GITHUB_ENV
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: false
- name: Set up Conda 3.11
uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.11
activate-environment: build
environment-file: .github/environments/build.yml
- name: Build a Conda tarbal
run: |
conda build -c conda-forge -c cmutel ./recipe/
- name: Publish to Anaconda
run: |
anaconda -t ${{ secrets.CONDA_LCA }} upload \
/usr/share/miniconda/envs/build/conda-bld/noarch/*.conda