-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Update update-versions.yml github action pipeline"
This reverts commit 45fdc68.
- Loading branch information
Showing
1 changed file
with
33 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |