publish to PiPy #8
This file contains 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: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
name: Build and Test | |
jobs: | |
build_test: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
env: | |
AWS_DEFAULT_REGION: us-east-1 | |
DNS_ADDRESS: 127.0.0.1 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Pull LocalStack Docker image | |
run: docker pull localstack/localstack & | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install OpenToFu | |
run: make install-opentofu | |
- name: Install dependencies | |
run: make install | |
- name: Run code linter | |
run: make lint | |
- name: Run tests | |
run: make test | |
pypi-publish: | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/opentofu-local | |
permissions: | |
id-token: write | |
steps: | |
- name: Build Dist | |
run: | | |
python3 -m pip install wheel | |
python3 setup.py sdist bdist_wheel | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |