Upload Dev Python Package #248
Workflow file for this run
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
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
name: Upload Dev Python Package | |
on: | |
release: | |
types: [created] | |
pull_request: | |
types: | |
- closed | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: upload release to PyPI | |
runs-on: ubuntu-latest | |
# Specifying a GitHub environment is optional, but strongly encouraged | |
environment: | |
name: dev | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.sha }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
# retrieve your distributions here | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build setuptools poetry | |
- name: Build | |
run: poetry build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Clone GuillaumeFalourd/poc-github-actions PUBLIC repository | |
uses: GuillaumeFalourd/clone-github-repo-action@v2 | |
with: | |
owner: 'FreeTAKTeam' | |
repository: 'FreeTAKHub-Installation' | |
- name: Run Ansible playbook | |
# You may pin to the exact commit or the version. | |
# uses: dawidd6/action-ansible-playbook@671974ed60e946e11964cb0c26e69caaa4b1f559 | |
uses: dawidd6/[email protected] | |
with: | |
# Ansible playbook filepath | |
playbook: FreeTAKHub-Installation/install_all.yml | |
# SSH private key used to connect to the host | |
key: ${{secrets.DEV_SERVER_SSH_KEY}} | |
# Custom content to write into hosts | |
inventory: | | |
[all] | |
${{secrets.DEV_SERVER_ADDRESS}} ansible_sudo_pass=${{secrets.DEV_SERVER_PASSWORD}} ansible_connection=ssh ansible_user=${{secrets.DEV_SERVER_USERNAME}} | |
# Extra options that should be passed to ansible-playbook command | |
options: | | |
--verbose | |
# Set to "true" if root is required for running your playbook | |
sudo: true |