mirror of https://github.com/abpframework/abp.git
committed by
GitHub
1 changed files with 41 additions and 33 deletions
@ -1,33 +1,41 @@ |
|||||
name: Update Latest Versions |
import os |
||||
|
import json |
||||
on: |
import xml.etree.ElementTree as ET |
||||
release: |
|
||||
types: |
def get_version_from_common_props(): |
||||
- published |
""" common.props dosyasındaki versiyon bilgilerini çeker. """ |
||||
|
tree = ET.parse("common.props") |
||||
permissions: |
root = tree.getroot() |
||||
contents: write |
|
||||
pull-requests: write |
version = root.find(".//Version").text |
||||
|
leptonx_version = root.find(".//LeptonXVersion").text |
||||
jobs: |
|
||||
update-versions: |
return version, leptonx_version |
||||
runs-on: ubuntu-latest |
|
||||
steps: |
def update_latest_versions(): |
||||
- name: Checkout repository |
version, leptonx_version = get_version_from_common_props() |
||||
uses: actions/checkout@v2 |
|
||||
|
# Eğer versiyon "preview" içeriyorsa PR oluşturma (sadece stable versiyonlar için) |
||||
- name: Set up Python |
if "preview" in version or "rc" in version: |
||||
uses: actions/setup-python@v2 |
return False |
||||
with: |
|
||||
python-version: 3.x |
with open("latest-versions.json", "r") as f: |
||||
|
latest_versions = json.load(f) |
||||
- name: Install dependencies |
|
||||
run: | |
# Yeni versiyon bilgisini en üst sıraya ekle |
||||
python -m pip install --upgrade pip |
new_version_entry = { |
||||
pip install PyGithub |
"version": version, |
||||
|
"releaseDate": "", |
||||
- name: Update latest-versions.json and create PR |
"type": "stable", |
||||
env: |
"message": "", |
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} |
"leptonx": { |
||||
run: | |
"version": leptonx_version |
||||
python .github/scripts/update_versions.py |
} |
||||
|
} |
||||
|
|
||||
|
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 |
||||
|
|||||
Loading…
Reference in new issue