Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
name: Update Version
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
datajson:
|
|
description: 'Version to update'
|
|
required: true
|
|
version:
|
|
description: 'Another version parameter'
|
|
required: true
|
|
jobs:
|
|
update-version:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.12.2
|
|
|
|
- name: Update version in versions.json
|
|
run: |
|
|
data="${{ github.event.inputs.datajson }}"
|
|
python3 -c "import json, re; data=json.loads('$data'); file_data=json.load(open('versions.json')); file_data[list(data.keys())[0]] = data[list(data.keys())[0]]; file_data = dict(sorted(file_data.items(), key=lambda x: [int(part) if part.isdigit() else part for part in re.split(r'(\d+)', x[0])], reverse=True)); json.dump(file_data, open('versions.json', 'w'), indent=2)"
|
|
|
|
- name: Commit changes
|
|
run: |
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add versions.json
|
|
git commit -m "Added version ${{ github.event.inputs.version }}"
|
|
git push
|