From 2c1190df6328f3fa5507457a8a24a951a0b1e30d Mon Sep 17 00:00:00 2001 From: linpan Date: Mon, 20 Feb 2023 14:17:02 +0800 Subject: [PATCH] feat: init repo flow --- .github/workflow/publish-tag.yml | 38 ++++++++++++++------------ .github/workflow/release.yml | 24 ++++++++++++++++ .gitignore => ltou/template/.gitignore | 3 +- 3 files changed, 46 insertions(+), 19 deletions(-) rename .gitignore => ltou/template/.gitignore (99%) diff --git a/.github/workflow/publish-tag.yml b/.github/workflow/publish-tag.yml index 481840a..0449131 100644 --- a/.github/workflow/publish-tag.yml +++ b/.github/workflow/publish-tag.yml @@ -1,24 +1,28 @@ -name: Release python package +name: Publish Tag on: push: - tags: - - "*" + branches: + - main jobs: - deploy: + publish_tag: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - name: Install deps - uses: knowsuchagency/poetry-install@v1 - env: - POETRY_VIRTUALENVS_CREATE: false - - name: Release package - env: - POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} - run: poetry publish --build \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Python environment + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install Poetry + run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - + - name: Get version + id: get_version + run: echo ::set-output name=version::$(poetry version --no-interaction) + - name: Create and push tag + uses: mathieudutour/github-tag-action@v5.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tag: v${{ steps.get_version.outputs.version }} + message: "Release version v${{ steps.get_version.outputs.version }}" diff --git a/.github/workflow/release.yml b/.github/workflow/release.yml index e69de29..481840a 100644 --- a/.github/workflow/release.yml +++ b/.github/workflow/release.yml @@ -0,0 +1,24 @@ +name: Release python package + +on: + push: + tags: + - "*" + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install deps + uses: knowsuchagency/poetry-install@v1 + env: + POETRY_VIRTUALENVS_CREATE: false + - name: Release package + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + run: poetry publish --build \ No newline at end of file diff --git a/.gitignore b/ltou/template/.gitignore similarity index 99% rename from .gitignore rename to ltou/template/.gitignore index 8891959..e7c2bd7 100644 --- a/.gitignore +++ b/ltou/template/.gitignore @@ -1,12 +1,11 @@ ### Python template -.idea/ +../../.idea/ .vscode/ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class - # C extensions *.so