-
Notifications
You must be signed in to change notification settings - Fork 473
63 lines (60 loc) · 2.22 KB
/
create_req_files.yml
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
59
60
61
62
63
name: Create Requirements Files
on:
workflow_dispatch:
jobs:
create-req-files:
name: Create requirements files
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Upgrade setuptools, pip and wheel
run: python -m pip install -U setuptools pip wheel
- name: Install Python Connector
shell: bash
run: python -m pip install .
- name: Generate reqs file name
shell: bash
run: echo "requirements_file=temp_requirement/requirements_$(python -c 'from sys import version_info;print(str(version_info.major)+str(version_info.minor))').reqs" >> $GITHUB_ENV
- name: Create reqs file
shell: bash
run: |
mkdir temp_requirement
echo "# Generated on: $(python --version)" >${{ env.requirements_file }}
python -m pip freeze | grep -v snowflake-connector-python 1>>${{ env.requirements_file }} 2>/dev/null
echo "snowflake-connector-python==$(python -m pip show snowflake-connector-python | grep ^Version | cut -d' ' -f2-)" >>${{ env.requirements_file }}
id: create-reqs-file
- name: Show created req file
shell: bash
run: cat ${{ env.requirements_file }}
- uses: actions/upload-artifact@v3
with:
path: temp_requirement
push-files:
needs: create-req-files
name: Commit and push files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
- name: Download requirement files
uses: actions/download-artifact@v3
with:
name: artifact
path: tested_requirements
- name: Commit and push new requirements files
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add tested_requirements
git commit -m "Update requirements files" -a
git push