Skip to content

Bump version: 0.1.0 → 0.2.0 (#33) #77

Bump version: 0.1.0 → 0.2.0 (#33)

Bump version: 0.1.0 → 0.2.0 (#33) #77

Workflow file for this run

name: MiR Connector Workflow
on:
push:
branches:
- main
paths:
- mir_connector/**
pull_request:
branches:
- main
paths:
- mir_connector/**
jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
uses: py-actions/flake8@v2
with:
path: mir_connector
max-line-length: 100
- name: Check with black
uses: psf/black@stable
with:
version: "~= 23.0"
src: mir_connector
options: "--diff --check --line-length=100"
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
cd mir_connector
python -m pip install --upgrade pip
python -m pip install -e .["test"]
- name: Test with pytest
run: |
cd mir_connector
pytest
publish-pypi:
if: contains(github.event.head_commit.message, 'Bump version')
needs: [test, lint]
runs-on: ubuntu-latest
strategy:
fail-fast: true
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install Dependencies
run: |
cd mir_connector
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Build Package
run: |
cd mir_connector
python -m build --sdist
twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: mir_connector/dist/
publish-docker:
if: ${{ contains(github.event.head_commit.message, 'Bump version') }}
needs: [test, lint]
runs-on: ubuntu-latest
strategy:
fail-fast: true
environment: release
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set version environment variable
run: |
CONNECTOR_VERSION=$(grep -oP '(?<=current_version = ")[^"]*' mir_connector/.bumpversion.toml)
echo "CONNECTOR_VERSION=$CONNECTOR_VERSION" >> $GITHUB_ENV
echo "CONNECTOR_VERSION is '$CONNECTOR_VERSION'"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Google Artifact Registry
uses: docker/login-action@v3
with:
registry: us-central1-docker.pkg.dev
username: _json_key
password: ${{ secrets.GAR_JSON_KEY }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:mir_connector"
file: ./docker/Dockerfile
push: true
tags: us-central1-docker.pkg.dev/inorbit-integrations/connectors/mir_connector:${{ env.CONNECTOR_VERSION }}