-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.8 KB
/
update-plugins.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
name: Update CMEM Plugin List
on:
schedule:
- cron: "0 0 * * *" # Runs daily at midnight UTC
workflow_dispatch: # Allows manual triggering
jobs:
update-plugin-list:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Task
uses: arduino/setup-task@v1
- name: Set up python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install and configure poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dynamic versioning plugin
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install dependencies
run: |
poetry install
- name: Run cli query pypi.org and update package list
run: |
poetry run cmem-plugin-index data/plugins_info.json
- name: Upload to artifactory
env:
JF_CREDENTIALS: ${{ secrets.JF_CREDENTIALS }}
JF_URL: ${{ secrets.JF_URL }}
run: >
curl
--write-out '%{http_code}' --silent --output /dev/null -f
-u$JF_CREDENTIALS
-T data/plugins_info.json
"$JF_URL"
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if [[ $(git status --porcelain) ]]; then
git add data/plugins_info.json # Stage the JSON file
git commit -m "Update CMEM plugin information [$(date --utc)]"
git push
else
echo "No changes to commit"
fi