mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-09 01:47:58 -04:00
Automatically Convert CHANGELOG to Fastlane
This commit is contained in:
27
.github/changelog_to_fastlane.py
vendored
Normal file
27
.github/changelog_to_fastlane.py
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
changelogs = {}
|
||||
|
||||
with open('CHANGELOG.md') as changelog:
|
||||
version_code = None
|
||||
text = []
|
||||
|
||||
for line in changelog:
|
||||
if line.startswith("## "):
|
||||
if version_code != None:
|
||||
changelogs[version_code] = text
|
||||
|
||||
text = []
|
||||
match = re.match("## \S* - (\d*) \(\d{4}-\d{2}-\d{2}\)", line)
|
||||
if not match:
|
||||
raise ValueError(f"Invalid version line: {line}")
|
||||
version_code = match.group(1)
|
||||
else:
|
||||
text.append(line)
|
||||
|
||||
for version, description in changelogs.items():
|
||||
with open(os.path.join("fastlane", "metadata", "android", "en-US", "changelogs", f"{version}.txt"), "w") as fastlane_file:
|
||||
fastlane_file.write("".join(description).strip())
|
||||
24
.github/workflows/changelog-to-fastlane.yml
vendored
Normal file
24
.github/workflows/changelog-to-fastlane.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Convert CHANGELOG to Fastlane
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
convert_changelog_to_fastlane:
|
||||
runs-on: ubuntu-latest
|
||||
name: Convert CHANGELOG to Fastlane
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
id: checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Run converter script
|
||||
run: python .scripts/changelog_to_fastlane.py
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
title: "Update Fastlane changelogs"
|
||||
commit-message: "Update Fastlane changelogs"
|
||||
1
.github/workflows/contributors-to-file.yml
vendored
1
.github/workflows/contributors-to-file.yml
vendored
@@ -1,3 +1,4 @@
|
||||
name: Write contributors to file
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
Reference in New Issue
Block a user