Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to automate release of new versions #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jntesteves
Copy link
Contributor

@jntesteves jntesteves commented Feb 17, 2022

New year, new PR. Same issues... Still trying to resolve #189

So, what changed:
I've come to accept that I'll never reach out to the guys on Discord to work on the upstream CI, so the problem has to be solved on this repository alone. I've decided to use the GitHub API to get the last commit hashes from the repositories of the modules and just update the template with that. Sounds like a cheap lazy excuse of a solution, but in fact it works much better than I expected.

I've just created a test release on a local branch with this command:

[UPDATED with the changes discussed in comments below]

./release.sh --git-tag=v1.10.0 1.10.0+test.0

You can use --help to get the usual usage help. Note that the script commits to git and creates a tag, so use a branch to test and take care not to push test releases.

This time it works, I swear.

@flathubbot
Copy link

Started test build 78771

@flathubbot
Copy link

Started test build 78772

@flathubbot
Copy link

Build 78771 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/76651/org.libretro.RetroArch.flatpakref

@flathubbot
Copy link

Build 78772 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/76652/org.libretro.RetroArch.flatpakref

@RobLoach
Copy link
Collaborator

Very cool! Could we disable push by default? Or enable --no-push by default? Thanks for taking this on. Even having the latest commit attached is a huge step in the right direction.

@flathubbot
Copy link

Started test build 78796

@jntesteves
Copy link
Contributor Author

Very cool! Could we disable push by default? Or enable --no-push by default? Thanks for taking this on. Even having the latest commit attached is a huge step in the right direction.

Yes, I inverted the option to --push and just force-pushed the change. Since this was supposed to run on CI, I didn't think much of ergonomics for local use, but yeah, not pushing by default makes much more sense.

@flathubbot
Copy link

Build 78796 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/76676/org.libretro.RetroArch.flatpakref

@flathubbot
Copy link

Started test build 78912

@flathubbot
Copy link

Build 78912 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/76795/org.libretro.RetroArch.flatpakref

@RobLoach
Copy link
Collaborator

RobLoach commented Mar 5, 2022

Seem to be getting this error when running. Am I running it wrong?

./release.sh --git-tag=v1.10.1 1.10.1           
2022-03-04T19:13:55-05:00 INFO Rendering template from org.libretro.RetroArch.json.tmpl with VERSION_TAG=v1.10.1 to file org.libretro.RetroArch.json
./release.sh: 140: local: {: bad variable name

@jntesteves
Copy link
Contributor Author

Seem to be getting this error when running. Am I running it wrong?

./release.sh --git-tag=v1.10.1 1.10.1           
2022-03-04T19:13:55-05:00 INFO Rendering template from org.libretro.RetroArch.json.tmpl with VERSION_TAG=v1.10.1 to file org.libretro.RetroArch.json
./release.sh: 140: local: {: bad variable name

Hi, thanks for testing this. So, shell script is a complicated beast compatibility-wise. This seems to be a problem with dash and non-quoted variable assignment. I've used the opportunity while working on this script to improve my knowledge of POSIX-compliant shell script, testing with bash, dash, zsh and ash/busybox on an Alpine container, and still I let this one slip. That's how hard shell compatibility is.

What shell are you using? What OS?

PS: I just fixed it, but the fix broke zsh 😬

@RobLoach
Copy link
Collaborator

RobLoach commented Mar 5, 2022

We could flip it to use Node.js, or Python, or anything 🤷

@jntesteves
Copy link
Contributor Author

We could flip it to use Node.js, or Python, or anything shrug

I wanted something with no dependencies, so it would run on any CI server so I wouldn't need to care to ask what's running on it. And I also wanted to improve my script-fu. And shell script always feels like a good fit for build automation.

Anyway, I fixed it, it was just some creative quoting on my part. Quoting rules are by far the most complicated part of shell script in my opinion. I'm waiting one hour just to test some more. Github has a very low rate limit for their API, I can only test the script about 7 times before hitting it.

@jntesteves jntesteves force-pushed the feature/release-automation-2 branch from fae0d5e to 7fdaea9 Compare March 5, 2022 01:52
@flathubbot
Copy link

Started test build 80480

@jntesteves
Copy link
Contributor Author

@RobLoach I've amended and force-pushed it. Tested with on every shell this time.

@flathubbot
Copy link

Build 80480 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/78373/org.libretro.RetroArch.flatpakref

@RobLoach RobLoach added the Hold label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keep updated with upstream releases
3 participants