Skip to content

tweak (#3136)

tweak (#3136) #2

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
code-quality:
uses: mosaicml/ci-testing/.github/actions/[email protected]

Check failure on line 11 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yaml

Invalid workflow file

invalid value workflow reference: references to workflows must be rooted in '.github/workflows'
strategy:
matrix:
python_version:
- "3.9"
- "3.10"
- "3.11"
pip_deps:
- "[dev]"
with:
python_version: ${{ matrix.python_version }}
pip_deps: ${{ matrix.pip_deps }}
pypi-packaging:
name: Build and Publish mosaicml PyPI Package
needs:
- code-quality
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Build source and wheel distributions
run: |
if [[ "${{ github.ref }}" =~ refs\/tags\/v ]]; then
PYPI_PACKAGE_NAME="mosaicml"
else
PYPI_PACKAGE_NAME="mosaicml-test-$(date +%Y%m%d%H%M%S)"
fi
python -m pip install --upgrade build twine
COMPOSER_PACKAGE_NAME=$PYPI_PACKAGE_NAME python -m build
twine check --strict dist/*
- name: Publish 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: contains(github.ref, 'refs/tags/v')
with:
user: __token__
password: ${{ secrets.PROD_PYPI_API_TOKEN }}
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: contains(github.ref, 'refs/heads/') || contains(github.ref, 'refs/pull/')
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
pypi-composer-packaging:
name: Build and Publish composer PyPI Package
needs:
- code-quality
if: contains(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Build source and wheel distributions
run: |
PYPI_PACKAGE_NAME="composer"
python -m pip install --upgrade build twine
COMPOSER_PACKAGE_NAME=$PYPI_PACKAGE_NAME python -m build
twine check --strict dist/*
- name: Publish 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PROD_COMPOSER_PYPI_API_TOKEN }}
production-docker-images:
name: Build and Push Production Docker Images
needs:
- pypi-packaging
- pypi-composer-packaging
uses: ./.github/workflows/release-docker.yaml
if: contains(github.ref, 'refs/tags/v')
secrets:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}