Back out "build: simplify environment config" #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
name: release-please | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} | |
release-type: python | |
upload-pypi: | |
name: Upload to pypi | |
needs: [release-please] | |
if: ${{ needs.release-please.outputs.release_created == 'true' }} | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/karaage | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Run image | |
uses: abatilo/actions-poetry@v4 | |
with: | |
poetry-version: main | |
- name: Setup a local virtual environment (if no poetry.toml file) | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v4 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install system dependancies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcrack2-dev | |
- name: Install the project dependencies | |
run: poetry install | |
- name: Package project | |
run: poetry build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |