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

Distributable ZIP-package #129

Merged
merged 34 commits into from
Jul 29, 2023
Merged

Distributable ZIP-package #129

merged 34 commits into from
Jul 29, 2023

Conversation

RobinTail
Copy link
Collaborator

@RobinTail RobinTail commented Jul 28, 2023

Closes #115

Screenshot 2023-07-29 at 12 00 19

Benefits

  • Can remove JS folder and stop checking that it's in sync with TS
  • Can stop doing Next version bumping commits

Details

The PR makes plugin_version to exist only within a distributable package.

Documentation on annotated tags:
https://git-scm.com/book/en/v2/Git-Basics-Tagging

Versioning tool:
https://github.com/jbweston/miniver

@RobinTail RobinTail added the release Chores for releasing new versions label Jul 28, 2023
@coveralls
Copy link

coveralls commented Jul 28, 2023

Coverage Status

coverage: 100.0%. remained the same when pulling 932bc3f on zip-package-release into 2f3996b on develop.

@RobinTail
Copy link
Collaborator Author

The build works surprisingly well.

@RobinTail RobinTail linked an issue Jul 28, 2023 that may be closed by this pull request
@RobinTail
Copy link
Collaborator Author

It seems that miniver I should install myself

@RobinTail
Copy link
Collaborator Author

RobinTail commented Jul 28, 2023

ok, now CI is working as unknown which is expected

Successfully installed OctoRelay-unknown-g474ea56 RPi.GPIO-0.7.1

but Release workflow got this:

ERROR: Could not build wheels for OctoRelay, which is required to install pyproject.toml-based projects

@RobinTail
Copy link
Collaborator Author

OK. Now got to the actual package building with an expected error:

setuptools.extern.packaging.version.InvalidVersion: Invalid version: 'unknown-g78441c7'

@RobinTail
Copy link
Collaborator Author

At this point, instead of unknown I'm getting something really weird

Invalid version: 'Release-v1.2.0.dev39-g1f4a92c'

@RobinTail
Copy link
Collaborator Author

Clarified:

An "annotated" tag is a name in refs/tags that refers to a tag object. Get the tag name (say foo ) and then do a git cat-file -t foo . If it's an an annotated tag, cat-file will tell you that it's a "tag". If it's a simple tag, cat-file will tell you that it's a "commit".

[local] ➜  OctoRelay git:(zip-package-release) git cat-file -t Release-v1.2.0
tag
[local] ➜  OctoRelay git:(zip-package-release) git cat-file -t 2.3.0a1
commit

So, GitHub creates a lightweight tag when doing a release (at least pre-relese)

@RobinTail
Copy link
Collaborator Author

The corresponding discussion:
https://github.com/orgs/community/discussions/4924

@RobinTail
Copy link
Collaborator Author

🚀 Got it finally!

Screenshot 2023-07-29 at 01 45 08

@RobinTail RobinTail added the enhancement New feature or request label Jul 29, 2023
@RobinTail RobinTail marked this pull request as ready for review July 29, 2023 07:48
.gitattributes Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@RobinTail RobinTail added the documentation Improvements or additions to documentation label Jul 29, 2023
@RobinTail
Copy link
Collaborator Author

✅ workflow operational

Copy link
Collaborator Author

@RobinTail RobinTail left a comment

Choose a reason for hiding this comment

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

OK. I'm happy with it at this point.
I hope it will work.

@RobinTail
Copy link
Collaborator Author

After merging to master, the installation URL has to be changed in the plugins listing repo:
https://github.com/OctoPrint/plugins.octoprint.org/blob/gh-pages/_plugins/octorelay.md

@RobinTail RobinTail changed the title Zip package release Distributable ZIP-package Jul 29, 2023
@RobinTail RobinTail merged commit 8584429 into develop Jul 29, 2023
13 checks passed
@RobinTail
Copy link
Collaborator Author

RobinTail commented Jul 30, 2023

⚠️ QA passed with warnings

Since currently distributed installations refer to archive of the repo sources, installing the next release led to the usual download without JS (no control buttons in UI) and without version set, having weird unknown version in Software Update section:

Screenshot 2023-07-30 at 20 01 14

However, LUCKILY, this is great that it's immediately offers to update again. Because now it knows that the new distribution URL is the ZIP-package asset. So, the second update makes it work as expected.

Screenshot 2023-07-30 at 20 13 46

Anyway, the lack of control buttons is misleading and can be disappointing.
We need a stub JS in the sources, notifying users to go to Software Update section and perform the plugin update once again.

This was referenced Jul 30, 2023
RobinTail added a commit that referenced this pull request Jul 30, 2023
* Distributable ZIP-package (#129)

* Removing redundant env var in CI.

* Add sample releasing steps until the artifact upload.

* Add missing dependency installation step.

* Including changelog into the manifest.

* Add integration test.

* Removing JS file from the repo.

* Removing the changes checking step from UI CI.

* Add miniver installation step.

* Add versioning step.

* Installing miniver using GitHub Codespace.

* Ignoring some files.

* Using module name for importing version.

* Add EOL.

* Adding the miniver lines to setup.py.

* Add Wheels installation step.

* CI: excluding _version.py from coverage report.

* Changing the trigger for Release workflow.

* Trying checking with depth 0.

* Only trigger on published type of release.

* Patching miniver for using non-annotated tags.

* Add the asset attachment job.

* Using specific version of get-release action.

* Changing the package download link for pip.

* EOL for .gitattributes

* minor, empty line in setup.py

* Fix padding in release workflow.

* Readme: changing the latest ditribution link.

* Revert "Trying checking with depth 0."

This reverts commit 1f4a92c.

* Extracting versions into env, testing installation against variety.

* Fix: add wheel installation step to integration test.

* Minor: title.

* Fix: build job name.

* Ref: organizing the steps: UI first, Python next.

* Changelog: the future 2.3.0.

* JS: notification stub in sources (#132)

* Making a stub for installations from sources.

* Minor: grammar.

* Ref: moving show() to the end. Using cancel button of the dialog instead.

* Ref: shorter title.

* Release workflow: stub removal explicit step.

* Minior: comment.

* Removing color - looks too agressive.

* Fix: dialog notice font adjustments.

* Changelog: the future 3.0.0.

* Minor: text.

* Changelog: moving breaking changes to the top.

* Minor: text.

* Ref: keeping off-on near.

* Changelog: minor fixes and illustration.

* FIX: wrong latest release asset URL.
@RobinTail RobinTail deleted the zip-package-release branch August 2, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request release Chores for releasing new versions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to ZIP-package distribution channel
2 participants