-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (49 loc) · 1.61 KB
/
dependencies-update.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# GitHub Actions workflow to generate a requirements.txt, for all the
# automatic processing that GitHub does, from a Poetry setup file, and
# commit the requirements.txt to the repo
#
# Author: [email protected]
# See GitHub documentation: https://git.io/JJL7O
name: "Update dependency file"
on:
push:
paths:
- "pyproject.*"
- "poetry.lock"
jobs:
dependency-update:
name: dependency-update
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
poetry-version: ["1.3.1"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: poetry install
- name: Generate requirements.txt
run: poetry export -f requirements.txt --without-hashes > requirements.txt
- name: Generate requirements-dev.txt
run: poetry export --with dev -f requirements.txt --without-hashes > requirements-dev.txt
- name: Commit generated requirements.txt
uses: EndBug/add-and-commit@v9
with:
message: "Commit updated requirements for GH dependency graph + rtd.io"
add: "requirements*.txt"
cwd: "."
force: true
default_author: github_actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}