Skip to content

v2.20.4 - Update consensus stage names #49

v2.20.4 - Update consensus stage names

v2.20.4 - Update consensus stage names #49

Workflow file for this run

name: Deploy
on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: Version
type: string
pypi:
description: PyPI
required: true
type: boolean
default: false
docker:
description: Docker
required: true
type: boolean
default: true
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || '' }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Build
run: |
python -m venv .venv
chmod +x .venv/bin/activate
.venv/bin/activate
make build
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: assets
path: redbrick_sdk*.whl
retention-days: 90
- id: config
name: Config
run: |
RB_SDK_VERSION=`python -c 'import redbrick;print(redbrick.__version__)'`
echo "v$RB_SDK_VERSION" >> $GITHUB_STEP_SUMMARY
echo "version=$RB_SDK_VERSION" >> "$GITHUB_OUTPUT"
outputs:
version: ${{ steps.config.outputs.version }}
deploy-pypi:
runs-on: ubuntu-latest
needs:
- build
if: needs.build.result == 'success' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.pypi == 'true') || github.event_name == 'release')
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Download package
uses: actions/download-artifact@v4
with:
name: assets
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m venv .venv
chmod +x .venv/bin/activate
.venv/bin/activate
pip install --upgrade pip
pip install twine
twine upload redbrick_sdk*.whl
deploy-docker:
runs-on: ubuntu-latest
needs:
- build
if: needs.build.result == 'success' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.docker == 'true') || github.event_name == 'release')
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
Dockerfile
- name: Download package
uses: actions/download-artifact@v4
with:
name: assets
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: redbrickai/redbrick-sdk:${{ needs.build.outputs.version }},redbrickai/redbrick-sdk:latest
env:
DOCKER_BUILDKIT: 1