From 4ce1723fe09d232380a411b5e5cb107dbaae35fd Mon Sep 17 00:00:00 2001 From: shmyga Date: Tue, 29 Sep 2026 19:55:45 +0300 Subject: [PATCH] ci(action): add gitea actions --- .gitea/workflows/release.yaml | 20 +++++++++++++++++++ .gitea/workflows/test.yaml | 14 ++++++++++++++ action.yml | 36 +++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 .gitea/workflows/release.yaml create mode 100644 .gitea/workflows/test.yaml create mode 100644 action.yml diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..241ab33 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,20 @@ +name: release + +on: + push: + tags: ["*"] + +env: + POETRY_HTTP_BASIC_InfernalGames_USERNAME: ${{ vars.PUBLISH_USERNAME }} + POETRY_HTTP_BASIC_InfernalGames_PASSWORD: ${{ secrets.PUBLISH_TOKEN }} + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: https://git.shmyga.ru/InfernalGames/project-manager@master + with: + setup-python: true + - run: pm build -vv + - run: pm publish -vv diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..1537449 --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,14 @@ +name: test + +on: push + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: https://git.shmyga.ru/InfernalGames/project-manager@master + with: + setup-python: true + - run: pm lint -vv + - run: pm test -vv diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..f446d0b --- /dev/null +++ b/action.yml @@ -0,0 +1,36 @@ +name: "Project Manager" +inputs: + python-version: + default: "3.14" + setup-python: + default: false + venv-version: + default: "1" +runs: + using: "composite" + steps: + - id: setup-python + uses: actions/setup-python@v7 + with: + python-version: ${{ inputs.python-version }} + cache: "pip" + + - run: | + pip install project-manager \ + --index-url https://git.shmyga.ru/api/packages/InfernalGames/pypi/simple/ \ + --extra-index-url https://pypi.org/simple + + - run: pm setup:config -vv + + - if: inputs.setup-python + run: pip install poetry + + - id: cache-venv + if: inputs.setup-python + uses: actions/cache@v6 + with: + path: .venv + key: venv-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-v${{ inputs.venv-version }} + + - if: inputs.setup-python and steps.cache-venv.outputs.cache-hit != 'true' + run: pm setup:python -vv