pypilot/.github/workflows/publish.yml

54 lines
1.4 KiB
YAML
Raw Normal View History

name: Publish
on:
push:
branches:
- "main"
paths-ignore:
- 'README.md'
- 'LICENSE.md'
- 'CHANGELOG.md'
- '.gitignore'
- 'renovate.json'
- 'CODEOWNERS'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
2024-04-27 18:28:14 +01:00
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
- name: Install dependencies
2024-04-27 18:28:14 +01:00
run: poetry install
- name: Build wheel file
2024-04-27 18:28:14 +01:00
run: poetry build
- id: skip_check
uses: actions/upload-artifact@v4
with:
name: whl
path: dist/
publish:
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
2024-04-27 18:28:14 +01:00
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Create dist folder
2024-04-27 18:28:14 +01:00
run: mkdir -p dist
- uses: actions/download-artifact@v4
with:
name: whl
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1