Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish automation #3

Merged
merged 9 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 35 additions & 21 deletions .github/workflows/publish-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Upload Python Package to PyPI

on:
workflow_dispatch:
push:
branches:
- dev
- main
release:
types: [published]

Expand All @@ -27,10 +31,11 @@ jobs:
- name: Build package
run: python -m build

- name: ls
run: |
pwd
ls -lR
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist/

publish-test:
runs-on: ubuntu-latest
Expand All @@ -40,24 +45,33 @@ jobs:
needs: build

steps:

- name: ls
run: |
pwd
ls -lR
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: dist
path: ./dist/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/

# publish-production:
# runs-on: ubuntu-latest
# environment: production
# permissions:
# id-token: write
# needs: publish-test

# steps:
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
repository-url: https://test.pypi.org/legacy/


publish-production:
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write
needs: publish-test
if:
github.ref == 'refs/heads/main'

steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: dist
path: ./dist/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include src/tftui/*.css
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@

## Preview


![](https://link.to.image "preview")

## Installation

### macOS

`gh` is available via [Homebrew][], [MacPorts][], [Conda][], [Spack][], and as a downloadable binary from the [releases page][].

#### pipx

| Install: | Upgrade: |
| ----------------- | ----------------- |
| `pipx install tftui` | `pipx upgrade tftui` |
| Tool | Install | Upgrade |
|-----------------| ------------------- | ----------------------------- |
| PIP | `pip install tftui` | `pip install --upgrade tftui` |

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"

[project]
name = "tftui"
version = "0.1.0"
version = "0.1.2"
description = "Terraform Textual User Interface"
readme = "README.md"
authors = [{ name = "Ido Avraham" }]
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: Apache License",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
Expand Down
5 changes: 5 additions & 0 deletions src/tftui/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def on_mount(self) -> None:
data = ""

status = self.get_widget_by_id("status")
result = subprocess.run(["terraform", "init", "-no-color"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
if result.returncode != 0:
status.update(f"{result.stderr} {result.stdout}")
return

status.update("Loading state...")
result = subprocess.run(["terraform", "show", "-no-color"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)

Expand Down
Loading