Skip to content

chore: add CODEOWNERS, CONTRIBUTING, and dependabot config #296

chore: add CODEOWNERS, CONTRIBUTING, and dependabot config

chore: add CODEOWNERS, CONTRIBUTING, and dependabot config #296

name: Release and PyPI Publish
on:
push:
branches:
- main
jobs:
release-and-publish:
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ADMIN_TOKEN }}
- name: Check if should skip
id: check_skip
run: |
if [ "$(git log -1 --pretty=format:'%an')" = "OpenAdapt Bot" ]; then
echo "skip=true" >> $GITHUB_OUTPUT
fi
- name: Set up Python
if: steps.check_skip.outputs.skip != 'true'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
if: steps.check_skip.outputs.skip != 'true'
run: pip install poetry
- name: Python Semantic Release
if: steps.check_skip.outputs.skip != 'true'
uses: python-semantic-release/python-semantic-release@v9.6.0
with:
github_token: ${{ secrets.ADMIN_TOKEN }}
git_committer_name: "OpenAdapt Bot"
git_committer_email: "bot@openadapt.ai"
- name: Build and publish to PyPI
if: steps.check_skip.outputs.skip != 'true'
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
git pull
poetry config pypi-token.pypi $PYPI_TOKEN
poetry build
poetry publish --no-interaction --skip-existing