Skip to content

Commit

Permalink
Revert "Update update-versions.yml github action pipeline"
Browse files Browse the repository at this point in the history
This reverts commit 45fdc68.
  • Loading branch information
skoc10 committed Feb 7, 2025
1 parent 45fdc68 commit 05efbb7
Showing 1 changed file with 33 additions and 41 deletions.
74 changes: 33 additions & 41 deletions .github/workflows/update-versions.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
import os
import json
import xml.etree.ElementTree as ET

def get_version_from_common_props():
""" common.props dosyasındaki versiyon bilgilerini çeker. """
tree = ET.parse("common.props")
root = tree.getroot()

version = root.find(".//Version").text
leptonx_version = root.find(".//LeptonXVersion").text

return version, leptonx_version

def update_latest_versions():
version, leptonx_version = get_version_from_common_props()

# Eğer versiyon "preview" içeriyorsa PR oluşturma (sadece stable versiyonlar için)
if "preview" in version or "rc" in version:
return False

with open("latest-versions.json", "r") as f:
latest_versions = json.load(f)

# Yeni versiyon bilgisini en üst sıraya ekle
new_version_entry = {
"version": version,
"releaseDate": "",
"type": "stable",
"message": "",
"leptonx": {
"version": leptonx_version
}
}

latest_versions.insert(0, new_version_entry) # Yeni versiyonu en üste ekliyoruz

with open("latest-versions.json", "w") as f:
json.dump(latest_versions, f, indent=2)

return True
name: Update Latest Versions

on:
release:
types:
- published

permissions:
contents: write
pull-requests: write

jobs:
update-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub
- name: Update latest-versions.json and create PR
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
python .github/scripts/update_versions.py

0 comments on commit 05efbb7

Please sign in to comment.