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

Build Script Improvements and Update Automation #8

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ProjectSynchro
Copy link
Contributor

@ProjectSynchro ProjectSynchro commented Sep 26, 2024

Updates the application to version 0.8.0, and the FreeDesktop runtime to 24.08.

The manifest has been updated to consume upstream deb packages, enable support for Wayland and uses the external data checker for updates.
I also added an updated metainfo which includes new version information, as well as other information related to the project.

This changes this flatpak to be built from existing binaries. This is mainly due to the difficulty/feasibility behind building using electron-forge offline as well as the lack of support for v3 npm lockfiles in flatpak-builder-tools.

Currently this isn't possible with my testing (at least with the current flatpak tools) but if someone figures this out going back to source building is the way to go. Due to the fact that both AMD64 and ARM64 debian packages are available upstream, nobody loses out on access to this application in the meantime however.

Let me know if you'd like any changes.

Obsoletes #7

@flathubbot
Copy link

Started test build 149656

@flathubbot
Copy link

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

flatpak install --user https://dl.flathub.org/build-repo/132751/tech.feliciano.pocket-casts.flatpakref

@flathubbot
Copy link

Started test build 149657

@flathubbot
Copy link

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

flatpak install --user https://dl.flathub.org/build-repo/132752/tech.feliciano.pocket-casts.flatpakref

@hadess
Copy link
Collaborator

hadess commented Sep 26, 2024

This changes this flatpak to be built from existing binaries. This is mainly due to the difficulty/feasibility behind building using electron-forge offline as well as the lack of support for v3 npm lockfiles in flatpak-builder-tools.

I'll let @FelicianoTech figure out whether this is acceptable. In my opinion, this should be worked on (or at least attempted to be worked on) upstream so that the package keeps being built from source.

I should also note that the commits don't seem to be organised correctly, the package should still be building after each commit...

local-build.sh Show resolved Hide resolved
0001-flatpak-Add-missing-item-in-appdata-file.patch Outdated Show resolved Hide resolved
tech.feliciano.pocket-casts.metainfo.xml Outdated Show resolved Hide resolved
tech.feliciano.pocket-casts.yml Outdated Show resolved Hide resolved
@flathubbot
Copy link

Started test build 149691

@ProjectSynchro
Copy link
Contributor Author

I should also note that the commits don't seem to be organised correctly, the package should still be building after each commit...

Seems like my changes didn't get correctly applied, force pushed so they are in the correct order, as well as removed some bad commits.

@flathubbot
Copy link

Build 149691 failed

@flathubbot
Copy link

Started test build 149694

@ProjectSynchro
Copy link
Contributor Author

I'm going to mark this as a draft, I may be able to get this to build from source after all.

@ProjectSynchro ProjectSynchro marked this pull request as draft September 26, 2024 08:32
@flathubbot
Copy link

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

flatpak install --user https://dl.flathub.org/build-repo/132789/tech.feliciano.pocket-casts.flatpakref

@flathubbot
Copy link

Started test build 149716

@flathubbot
Copy link

Build 149716 failed

@flathubbot
Copy link

Started test build 149719

@flathubbot
Copy link

Build 149719 failed

@ProjectSynchro
Copy link
Contributor Author

bot, build

@flathubbot
Copy link

Queued test build for tech.feliciano.pocket-casts.

@ProjectSynchro ProjectSynchro marked this pull request as ready for review September 26, 2024 11:24
@flathubbot
Copy link

Started test build 149722

@ProjectSynchro
Copy link
Contributor Author

Okay, round two.

I have figured out how to get source builds working again, and have bumped every dependency I could to the newest that is supported (FreeDesktop, Node).

Additionally I have a solution for managing automatic updates.

Normally if you aren't building a node app you can use flatpak-external-data-checker and it will bump the manifest and metainfo automatically (the metainfo is handy if there isn't anything upstream, mainly just adds a placeholder version tag though)

With node however we need to generate the NPM cache so the build works while offline. I implemented a Github Actions workflow that will update the generated-sources.json alongside any external-data-checker checks.

The external data checker will then create a PR for the update (if there is one) which gets test built by CI and then can be merged by maintainers if it works correctly.

Let me know if you'd like any changes. I'm pretty sure the commits can be built cleanly as you had mentioned you'd like it to be that way.

@ProjectSynchro
Copy link
Contributor Author

ProjectSynchro commented Sep 26, 2024

Some additional context on the Github Actions workflow:

It uses the docker based action provided by flathub, so external dependency-wise that is the only one, actions/checkout is maintained by Github and doesn't pose any issues in terms of maintainability.

Essentially the workflow checks with the external data checker if there is an update in an edit only mode, I then use git to check if there is any changes to files.

If there is, we get the latest upstream tagged release's package.json and package-lock.json and run flatpak-node-generator to get our generated-sources.json.

From there the git repository has the manifest file reset and the external data checker is called again in merge mode (which opens a PR with changes) that will open the PR with the manifest updates and the generated-sources.json updates.

Hopefully that helps outline what the workflow does.

@flathubbot
Copy link

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

flatpak install --user https://dl.flathub.org/build-repo/132822/tech.feliciano.pocket-casts.flatpakref

Copy link
Collaborator

@hadess hadess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea about the implications of using GitHub actions, it's something that "somebody" (you or I, or anybody else that might be reading this) would need to research.

I'm happy to commit the rest of the commits after the review changes are applied, if you want to put the GitHub actions changes in a separate PR.

local-build.sh Outdated Show resolved Hide resolved
tech.feliciano.pocket-casts.yml Outdated Show resolved Hide resolved
001-update-metainfo.patch Outdated Show resolved Hide resolved
001-update-metainfo.patch Outdated Show resolved Hide resolved
001-update-metainfo.patch Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ProjectSynchro
Copy link
Contributor Author

I have no idea about the implications of using GitHub actions, it's something that "somebody" (you or I, or anybody else that might be reading this) would need to research.

I'm happy to commit the rest of the commits after the review changes are applied, if you want to put the GitHub actions changes in a separate PR.

I can do that. I have tested it on my fork already and it seems to work well.

See here for a PR example: ProjectSynchro#3

And See the worflow run here: https://github.com/ProjectSynchro/tech.feliciano.pocket-casts/actions/runs/11058580552/job/30724922447

@hadess
Copy link
Collaborator

hadess commented Oct 8, 2024

I've reordered and merged most of the necessary changes for the build in #10

You can remove Bump FreeDesktop Runtime to 24.08, bump node to node20 from this and keep only the dependency automation to avoid opening a new PR.

The appdata and desktop file changes will definitely have to go through upstream, rather than the very large changes in this PR.

@hadess hadess changed the title Update Pocket Casts to version 0.8.0 and the FreeDesktop runtime to 24.08 Automate dependencies update Oct 8, 2024
@ProjectSynchro
Copy link
Contributor Author

Apologies, got swamped with work.

I'll clean this up to just include the workflow commits and changes.

@flathubbot
Copy link

Started test build 152945

This stops build directories and files from accidentally being staged.
This prevents any updates to the manifest via the external data checker due to the need to update dependencies externally.
@ProjectSynchro ProjectSynchro reopened this Oct 9, 2024
@ProjectSynchro
Copy link
Contributor Author

Not quite sure why Github closed this, oh well.

I'll set it as a draft for now.

@ProjectSynchro ProjectSynchro marked this pull request as draft October 9, 2024 15:52
@flathubbot
Copy link

Build 152945 failed

@flathubbot
Copy link

Started test build 152956

This should make this a one shot script, assuming flatpak and flatpak-builder are installed.
This will check for dependencies and generate an updated generated-sources.json.
@flathubbot
Copy link

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

flatpak install --user https://dl.flathub.org/build-repo/136040/tech.feliciano.pocket-casts.flatpakref

…cation updates.

This uses flatpak-external-data-checker itself to update the manifest, as well as node dependencies using flatpak-node-generator.
@ProjectSynchro ProjectSynchro marked this pull request as ready for review October 9, 2024 16:33
@ProjectSynchro
Copy link
Contributor Author

Ready to go now.

@ProjectSynchro ProjectSynchro changed the title Automate dependencies update Build Script Improvements and Update Automation Oct 9, 2024
@flathubbot
Copy link

Started test build 152965

@flathubbot
Copy link

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

flatpak install --user https://dl.flathub.org/build-repo/136049/tech.feliciano.pocket-casts.flatpakref

@hadess
Copy link
Collaborator

hadess commented Oct 9, 2024

I have no idea about the implications of using GitHub actions, it's something that "somebody" (you or I, or anybody else that might be reading this) would need to research.

Discussion is here:
https://discourse.flathub.org/t/using-github-actions-workflow-to-update-deps/7816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants