-
-
Notifications
You must be signed in to change notification settings - Fork 30
82 lines (65 loc) · 2.6 KB
/
cron-vendor.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: "Vendor Update"
on:
schedule:
- cron: '0 10 * * 6' # everyday at 10am
push:
branches: [main, ]
jobs:
vendor-update:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: Install and Setup
run: |
set -x
python -m pip install -U pip setuptools wheel
python -m pip install -U isort
python -m pip install -e .[all]
- name: Update Vendor
run: |
set -x
export PCAPKIT_VENDOR_RETRY=10
export PCAPKIT_CI_MODE=1
pcapkit-vendor
isort -l100 -ppcapkit pcapkit/const/*/*.py
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v17
id: verify-changed-files
- name: Bump Version
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
set -x
python util/bump_version.py
isort -l100 -ppcapkit --skip-glob '**/__init__.py' pcapkit
isort -l100 -ppcapkit pcapkit/const/*/*.py
isort -l100 -ppcapkit pcapkit/vendor/*/*.py
- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am"Bumped version to $(python -c 'import pcapkit; print(pcapkit.__version__)')
Updated vendor constant enumerations at $(date). The following files
have been changed: ${{ steps.verify-changed-files.outputs.changed_files }}"
- name: Push changes
uses: ad-m/github-push-action@master
if: steps.verify-changed-files.outputs.files_changed == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
# - name: Create Tag
# if: steps.verify-changed-files.outputs.files_changed == 'true'
# run: |
# version=$(python -c 'import pcapkit; print(pcapkit.__version__)')
# git tag "v$version" -m "New distribution [$version] \
# Update vendor constant enumerations at $(date). The following files have been changed: ${{ steps.verify-changed-files.outputs.changed_files }}"
# - name: Push changes
# uses: ad-m/github-push-action@master
# if: steps.verify-changed-files.outputs.files_changed == 'true'
# with:
# tags: true
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: ${{ github.ref }}