Create release tag #7
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
name: Create release tag | |
on: | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: 'The version to tag (without the "v" prefix)' | |
required: true | |
type: string | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update recorded version | |
run: sed -i -Ee 's/(config.version\s*=\s*")[^"]+"/\1${{ inputs.version_number }}"/g' game/options.rpy | |
- name: Update android version | |
run: | | |
python3 - <<EOF | |
import json | |
with open("android.json", "r") as f: | |
content = json.loads(f.read()) | |
content["version"] = "${{ inputs.version_number }}" | |
with open("android.json", "w") as f: | |
f.write(json.dumps(content, sort_keys=True, indent=4)) | |
EOF | |
- run: git diff | |
- name: Commit files changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
push: true | |
message: "autobot: set version to ${{ inputs.version_number }}" | |
tag: v${{ inputs.version_number }} --force |