Skip to content

Update CMEM Plugin List #18

Update CMEM Plugin List

Update CMEM Plugin List #18

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