Skip to content

Commit

Permalink
feat: init repo flow
Browse files Browse the repository at this point in the history
  • Loading branch information
linpan committed Feb 20, 2023
1 parent 6640607 commit 2c1190d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
38 changes: 21 additions & 17 deletions .github/workflow/publish-tag.yml
Original file line number Diff line number Diff line change
@@ -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
- 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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ steps.get_version.outputs.version }}
message: "Release version v${{ steps.get_version.outputs.version }}"
24 changes: 24 additions & 0 deletions .github/workflow/release.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions .gitignore → ltou/template/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
### Python template

.idea/
../../.idea/
.vscode/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

Expand Down

0 comments on commit 2c1190d

Please sign in to comment.