Skip to content

A more detailed list of clients (#63) #7

A more detailed list of clients (#63)

A more detailed list of clients (#63) #7

Workflow file for this run

name: Push to Main
on:
workflow_dispatch: {}
push:
branches:
- main
jobs:
version-check:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.check-version.outputs.new_version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check Version
id: check-version
run: |
version=$(grep -P -o 'version = "\d+\.\d+\.\d+"' pyproject.toml | grep -P -o '\d+\.\d+\.\d+')
tags=$(git tag -l '*.*.*')
match=$(echo ${tags} | grep -w -c ${version} | cat)
if [ "${match}" == "0" ]; then
echo "new_version=${version}" >> "${GITHUB_OUTPUT}"
else
echo "new_version=false" >> "${GITHUB_OUTPUT}"
fi
python-package:
runs-on: ubuntu-latest
needs: version-check
if: ${{ needs.version-check.outputs.new_version != 'false' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
- name: Install Build Tools
run: pip install --upgrade build twine
- name: Build
run: python3 -m build
- name: Upload
run: |
python3 -m twine upload \
--verbose --non-interactive \
--username __token__ --password ${{ secrets.PYPI_TOKEN }} \
dist/*
- name: Tag
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
custom_tag: "${{ needs.version-check.outputs.new_version }}"
tag_prefix: ""
default_bump: false
rock:
uses: canonical/observability/.github/workflows/build-rock.yaml@main
needs: python-package
secrets: inherit
with:
rock-name: cos-alerter
tag-minor: true