Bump version: 0.5.4 → 0.5.5 #80
Workflow file for this run
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: release-blobtk | |
on: | |
push: | |
branches: | |
# - main | |
- feature/release-action | |
tags: | |
- "*" | |
env: | |
VERSION: 0.5.5 | |
jobs: | |
macos-binary: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-apple-darwin | |
- name: Build | |
working-directory: ./rust | |
run: | | |
cargo build --target=x86_64-apple-darwin --release | |
- name: Rename binary | |
run: | | |
mv ./rust/target/x86_64-apple-darwin/release/blobtk ./rust/target/x86_64-apple-darwin/release/blobtk-macos-x64 | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: rust/target/x86_64-apple-darwin/release/blobtk-macos-* | |
macos-binary-arm64: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: aarch64-apple-darwin | |
- name: Build | |
working-directory: ./rust | |
run: | | |
cargo build --target=aarch64-apple-darwin --release | |
- name: Rename binary | |
run: | | |
mv ./rust/target/aarch64-apple-darwin/release/blobtk ./rust/target/aarch64-apple-darwin/release/blobtk-macos-arm64 | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: rust/target/aarch64-apple-darwin/release/blobtk-macos-* | |
linux-binary: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install static libraries for C | |
run: sudo apt-get install -y libc6-dev | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: x86_64-unknown-linux-gnu | |
- name: Build | |
working-directory: ./rust | |
run: RUSTFLAGS="-C target-feature=+crt-static -C relocation-model=static" cargo build --target x86_64-unknown-linux-gnu --release | |
- name: Rename binary | |
run: | | |
mv ./rust/target/x86_64-unknown-linux-gnu/release/blobtk ./rust/target/release/blobtk-linux | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: ./rust/target/release/blobtk-* | |
sdist-wheels: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --out dist -m rust/Cargo.toml | |
- name: Upload sdist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
linux-wheels: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
target: | |
- x86_64 # , x86, aarch64, armv7, s390x, ppc64le] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
before-script-linux: yum install -y perl-IPC-Cmd | |
args: --release --out dist -i python${{ matrix.python }} --target x86_64-unknown-linux-gnu -m rust/Cargo.toml | |
sccache: "true" | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
# windows: | |
# runs-on: windows-latest | |
# strategy: | |
# matrix: | |
# target: [x64] # , x86] | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: "3.10" | |
# architecture: ${{ matrix.target }} | |
# - name: Build wheels | |
# uses: PyO3/maturin-action@v1 | |
# with: | |
# target: ${{ matrix.target }} | |
# args: --release --out dist --find-interpreter -m rust/Cargo.toml | |
# sccache: "true" | |
# - name: Upload wheels | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: wheels | |
# path: dist | |
macos-wheels: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{matrix.python}} | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
args: --release --out dist -i python${{matrix.python}} --target x86_64-apple-darwin -m rust/Cargo.toml | |
sccache: "true" | |
- name: Build universal wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
args: --release --out dist -i python${{matrix.python}} --universal2 -m rust/Cargo.toml | |
sccache: "true" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
build-and-push-docker-develop: | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: genomehubs/blobtk | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./rust | |
push: true | |
tags: genomehubs/blobtk:develop | |
labels: ${{ steps.meta.outputs.labels }} | |
create-conda-release-macos: | |
name: Create conda release Mac | |
runs-on: macos-latest | |
# if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- macos-binary | |
- macos-wheels | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: "3.10" | |
- uses: actions/download-artifact@v3 | |
with: | |
name: binaries | |
path: ./dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: ./dist | |
- name: copy files | |
run: | | |
mkdir -p ./conda/dist | |
cp ./dist/*macos*x86_64.whl ./conda/dist/ | |
cp ./dist/blobtk-macos-x64 ./conda/dist/blobtk | |
- name: conda build | |
run: | | |
conda install -y conda-build | |
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_API_TOKEN }} | |
mkdir -p ./dist/osx-64 | |
conda build --no-anaconda-upload ./conda --output-folder ./dist | |
ls ./dist/* | |
- name: Upload package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: conda | |
path: dist | |
# create-conda-release-macos-arm64: | |
# name: Create conda release Mac arm64 | |
# runs-on: self-hosted | |
# # if: startsWith(github.ref, 'refs/tags/') | |
# needs: | |
# - macos-binary-arm64 | |
# - macos-wheels | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: conda-incubator/setup-miniconda@v2 | |
# with: | |
# auto-update-conda: true | |
# python-version: "3.10" | |
# - uses: actions/download-artifact@v3 | |
# with: | |
# name: binaries | |
# path: ./dist | |
# - uses: actions/download-artifact@v3 | |
# with: | |
# name: wheels | |
# path: ./dist | |
# - name: copy files | |
# run: | | |
# mkdir -p ./conda/dist | |
# cp ./dist/*macos*universal2.whl ./conda/dist/ | |
# cp ./dist/blobtk-macos-arm64 ./conda/dist/blobtk | |
# - name: conda build | |
# run: | | |
# conda install -y conda-build | |
# export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_API_TOKEN }} | |
# mkdir -p ./dist/osx-arm64 | |
# conda build --no-anaconda-upload ./conda --output-folder ./dist | |
# ls ./dist/* | |
# - name: Upload package | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: conda | |
# path: dist | |
create-conda-release-linux: | |
name: Create conda release Linux | |
runs-on: ubuntu-latest | |
# if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- linux-binary | |
- linux-wheels | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: binaries | |
path: ./dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: ./dist | |
- name: copy files | |
run: | | |
mkdir -p ./conda/dist | |
cp ./dist/*linux*.whl ./conda/dist/ | |
cp ./dist/blobtk-linux ./conda/dist/blobtk | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: latest | |
auto-activate-base: true | |
activate-environment: "" | |
- name: conda build | |
run: | | |
conda install -y conda-build | |
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_API_TOKEN }} | |
mkdir -p ./dist/linux-64 | |
conda build --no-anaconda-upload ./conda --output-folder ./dist | |
ls ./dist/* | |
- name: Upload package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: conda | |
path: dist | |
create-github-release: | |
name: Create GitHub release | |
runs-on: ubuntu-latest | |
needs: | |
- create-conda-release-linux | |
- create-conda-release-macos | |
- macos-binary-arm64 | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
path: ./dist | |
- name: create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/binaries/blobtk-* | |
dist/wheels/blobtk-* | |
# dist/wheels/blobtk*.tar.gz | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-crate: | |
name: Publish crate | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: create-github-release | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Publish | |
working-directory: ./rust | |
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} | |
upload-to-pypi: | |
name: Upload to PyPI | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- create-github-release | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
pip install --upgrade twine | |
twine upload --skip-existing * | |
build-and-push-docker-release: | |
runs-on: ubuntu-latest | |
needs: create-github-release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: genomehubs/blobtk | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./rust | |
push: true | |
tags: genomehubs/blobtk:${{ env.VERSION }}, genomehubs/blobtk:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
upload-to-conda: | |
name: Upload to conda | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- create-github-release | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: conda | |
path: ./dist | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: latest | |
auto-activate-base: true | |
activate-environment: "" | |
- name: conda upload | |
shell: bash -l {0} | |
run: | | |
conda install -y anaconda-client | |
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_API_TOKEN }} | |
anaconda upload --force --label main ./dist/linux-64/*.tar.bz2 | |
anaconda upload --force --label main ./dist/osx-64/*.tar.bz2 | |
# anaconda upload --force --label main ./dist/osx-arm64/*.tar.bz2 |