From cbf4900c5c3b1de65e55ce480d4b453091528e84 Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Sun, 11 Apr 2021 15:03:35 +0800 Subject: =?UTF-8?q?=F0=9F=9A=80=E2=9C=A8=E2=9A=A1=EF=B8=8F=F0=9F=8E=A8?= =?UTF-8?q?=F0=9F=90=9B=20=E6=AD=A3=E5=BC=8F=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/requirements.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/requirements.yml (limited to '.github') diff --git a/.github/workflows/requirements.yml b/.github/workflows/requirements.yml new file mode 100644 index 0000000..7c24d4c --- /dev/null +++ b/.github/workflows/requirements.yml @@ -0,0 +1,41 @@ +name: Generate Requirements + +on: + workflow_dispatch: + + push: + paths: + - poetry.lock + - pyproject.toml + - requirements.txt + +jobs: + generate: + name: Requirements + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - uses: Gr1N/setup-poetry@v4 + with: + path: ~/.cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} + restore-keys: ${{ runner.os }}-poetry- + + - name: Generate dependencies + run: | + poetry export -f requirements.txt -o requirements.txt + + - name: Push to repository + run: | + [[ -z "$(git status -s)" ]] && exit + git config user.name github-action + git config user.email noreply@github.com + git add requirements.txt + git commit -am ":pushpin: Update requirements.txt" + git push -- cgit v1.2.3