Skip to content

Commit

Permalink
Fix Flatpak release script
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Jun 28, 2024
1 parent ea7245e commit ad48808
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ curl -o /c/opt/flatpak-cargo-generator.py https://raw.githubusercontent.com/flat
pip install aiohttp toml
```

Also install the Crowdin and `yq` CLI tools manually.
Also install the Crowdin CLI tool manually.

#### Process
* Update version in CHANGELOG.md
Expand Down
8 changes: 7 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,20 @@ def release(ctx):
@task
def release_flatpak(ctx, target="/git/com.github.mtkennerly.ludusavi"):
target = Path(target)
spec = target / "com.github.mtkennerly.ludusavi.yaml"
version = get_version()

with ctx.cd(target):
ctx.run("git checkout master")
ctx.run("git pull")
ctx.run(f"git checkout -b release/v{version}")

shutil.copy(DIST / "generated-sources.json", target / "generated-sources.json")
ctx.run(f"yq -i '.modules.0.sources.0.tag = \"v{version}\"' com.github.mtkennerly.ludusavi.yaml")
spec_content = spec.read_bytes().decode("utf-8")
spec_content = re.sub(r"( tag:) (.*)", fr"\1 v{version}", spec_content)
spec.write_bytes(spec_content.encode("utf-8"))

ctx.run("git add .")
ctx.run(f'git commit -m "Update for v{version}"')
ctx.run("git push origin HEAD")

Expand Down

0 comments on commit ad48808

Please sign in to comment.