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

PyAction Package #28

Merged
merged 17 commits into from
Apr 13, 2024
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
5 changes: 0 additions & 5 deletions .bumpversion.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docs ci
name: Docs Building

on:
push:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Package Releasing

on:
push:
tags:
- v*

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish new distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: main
name: Package Testing

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ celerybeat.pid
*.sage.py

# Environments
# .env
.env
.venv
env/
venv/
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
exclude: "{{cookiecutter.action_slug}}"
exclude: "pyaction/template"

repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: ".bumpversion.cfg"
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
Expand Down
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
## PyAction [![docs ci](https://github.com/lnxpy/pyaction/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/lnxpy/pyaction/actions/workflows/docs.yml) [![main](https://github.com/lnxpy/pyaction/actions/workflows/main.yml/badge.svg)](https://github.com/lnxpy/pyaction/actions/workflows/main.yml) ![version)](https://img.shields.io/github/v/tag/lnxpy/pyaction?label=Version)

PyAction helps you to develop [GitHub Actions](https://docs.github.com/en/actions) using Python. It's delivered as an installable package with the ability to test the action locally before any deployment.

Check out the [official docs](https://pyaction.imsadra.me) for more detailed information. There is also a [Quickstart](https://pyaction.imsadra.me/quickstart) demo tutorial that walks you through a simple hello-world action.

PyAction is a [Cookiecutter](https://cookiecutter.io) template that allows you to develop custom [GitHub Actions](https://docs.github.com/en/actions) using [Python3](https://python.org/).

<!-- > [!NOTE]
> Read ["Writing GitHub Actions in Python"](https://imsadra.me/writing-github-actions-in-python) article that walks you through a hello-world example. -->
### Requirements
- Python >= 3.8
- pip

### Installation
Make sure you have Python and `pip` installed on your machine and install the `cookiecutter` package. That's the template generator tool.
Run the following command in a fresh CLI tab.

```sh
pip install -U cookiecutter
pip install -U pyaction
```

### Usage
In order to create the template, run the following command.
To make sure the installation process was successful, run the following command.

```sh
cookiecutter gh:lnxpy/pyaction
pyaction --version
```

Answer the prompts and your template will be generated.
### Usage
It's recommended to initialize a template, then going along the development process. Thus, run the `init` command.

```sh
pyaction init
```

### Docs
Check out the [official docs](https://pyaction.imsadra.me) for more information about PyAction and a demo hello-world action demonstration.
Answer the prompts and your template will be generated. Check out the docs for the further steps.

### Contribution
All your contributions and assistance are welcome. For more information about how you can contribute to the project, please follow the instructions [here](https://pyaction.imsadra.me/contributing). :beers:
All your contributions and assistance are welcome. For more information about how you can contribute to the project, please follow the instructions [here](https://pyaction.imsadra.me/contributing). :sparkles:

### License
PyAction is licensed under the terms of [MIT License](LICENSE).
PyAction is licensed under the [MIT License](LICENSE) terms.
15 changes: 0 additions & 15 deletions cookiecutter.json

This file was deleted.

6 changes: 2 additions & 4 deletions docs/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ hide:
- navigation
---

![Avatar](img/avatar.png){ align=right .avatar }

I'm Sadra, the creator of PyAction. If you have any questions, need any help, or have a change request, feel free to reach out to me on the following platforms. I'll try my best to respond back as soon as I can. :beers:
I'm Sadra, the creator of PyAction. If you have any questions, need any help, or have a change request, feel free to reach out to me on the following platforms. I'll try my best to respond as soon as I can. :beers:

<div class="grid cards" markdown>

Expand All @@ -18,4 +16,4 @@ I'm Sadra, the creator of PyAction. If you have any questions, need any help, or

</div>

You can also subscribe to [my newsletter](https://blog.imsadra.me) and enjoy my technical articles. As a Python developer, I mainly write about science, tech, and software.
You can also subscribe to [my newsletter](https://blog.imsadra.me) and enjoy my technical articles. As a Python developer, I mainly write about science, tech, and software. :writing_hand:
10 changes: 5 additions & 5 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ hide:
- navigation
---

Thanks for heading over to this index. I assume you're looking for a way to contributing to this project and as always, all your helps are welcome. Follow the instructions and enjoy contributing!
Thanks for heading over to this page. I assume you're looking for a way to contribute to this project and as always, all your helps are welcome. Follow the instructions and enjoy contributing!

!!! Note "Open an issue first please.."
!!! Info "Open an issue first please.."
I highly recommend you [open an issue](https://github.com/lnxpy/pyaction/issues/new/choose) first. Once we agree on the on-going conversation, then feel free to start working. :beers:

### Fork & Install
Expand All @@ -19,14 +19,14 @@ pip install pre-commit tox && pre-commit install

Once you're all set and need to test your changes in the supported environments, simply run `tox` and it'll grab your changes and puts them into test.

If you've changed the docs and want to see the results, run the following command and it'll serve your docs on [http://localhost:8000](http://localhost:8000).
If you've changed the docs and want to see the results, run the following command and it'll serve the docs on [localhost:8000](http://localhost:8000).

```bash
tox -e docs -- serve
tox -e docs
```

??? Note "Access the `venv` that `tox` has created.."
If you need to access an environment with all the dev dependencies installed, run the following command and it'll create a virtualenv with all the requiremenets installed in it.
If you need to access an environment with all the dev dependencies installed, run the following command and it'll create a virtualenv with all the requirements installed in it.

```bash
tox --devenv venv
Expand Down
47 changes: 43 additions & 4 deletions docs/css/navbar.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,64 @@
@import url('https://fonts.googleapis.com/css2?family=Manrope:[email protected]&display=swap');

.md-header {
background-color: black;
background-color: #0E1016;
box-shadow: none;
}

.md-tabs{
background-color: black;
background-color: #0E1016;
}

.md-footer{
background-color: #14161b;
}

.md-footer-meta{
background-color: black;
background-color: #0E1016;
}

.md-banner{
background-color: #F95428;
background: rgb(30,24,91);
background: linear-gradient(90deg, rgba(30,24,91,1) 0%, rgba(44,59,150,1) 15%, rgba(144,2,255,1) 100%);
}

.md-banner a{
color: white !important;
text-decoration: underline;
}

.rounded {
border-radius: 10px;
}

.md-main blockquote {
border-left: unset !important;
padding: 20px 0 20px 0;
}
.md-main blockquote:before {
opacity: 0.15;
z-index: -1;
content: open-quote;
font-family: manrope;
font-size: 11em;
line-height: 0.5em;
margin-left: -30px;
position: absolute;
}
.md-main blockquote p {
display: inline;
}

.md-main blockquote mark {
display: block;
background-color: unset;
margin-top: 13px;
font-style: italic;
color: #b45dfa;
}

.md-main blockquote mark::before {
color: #757575;
content: "—";
margin-right: 5px;
}
Loading
Loading