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

ci: add sha256sum and version.txt #599

Merged
merged 10 commits into from
Sep 19, 2024
Merged

ci: add sha256sum and version.txt #599

merged 10 commits into from
Sep 19, 2024

Conversation

Itsusinn
Copy link
Member

@Itsusinn Itsusinn commented Sep 19, 2024

No description provided.

@Itsusinn
Copy link
Member Author

#596 #597

@Itsusinn Itsusinn requested a review from ibigbug September 19, 2024 01:10
@Itsusinn Itsusinn force-pushed the ci/add-sha512sum-version branch from 4687375 to f6d595d Compare September 19, 2024 01:17
@Itsusinn Itsusinn changed the title ci: add sha512sum and version.txt ci: add sha256sum and version.txt Sep 19, 2024
@ibigbug ibigbug requested a review from greenhat616 September 19, 2024 01:22
@Itsusinn
Copy link
Member Author

@greenhat616 If you have any alternative requirement,please tell me

@Itsusinn Itsusinn force-pushed the ci/add-sha512sum-version branch from 5cab280 to 6123744 Compare September 19, 2024 01:58
@greenhat616
Copy link
Collaborator

greenhat616 commented Sep 19, 2024

we might use the cargo set-version from cargo-edit to make the consistent with the version.txt?
And here is the spec of semver: https://semver.org/#backusnaur-form-grammar-for-valid-semver-versions
So that x.y.z-tag+buildinfo is vaild for semver.

If the program version are inconsistant with the version.txt. The updater are supposed to create a independent lockfile to fix version by file chksum, which is not implemented yet now.

Here is the mihomo alpha channel output:

Mihomo Meta alpha-3676d1b windows amd64 with go1.23.1 Wed Sep 18 14:44:10 UTC 2024
Use tags: with_gvisor

It is consistent with the content of version.txt.
For manifest v1, we parsed the version, using it compare with the remote version.txt, and do the update logic.

@Itsusinn
Copy link
Member Author

Itsusinn commented Sep 19, 2024

we might use the cargo set-version from cargo-edit to make the consistent with the version.txt?

Doing so will crate tons of commits by bot(kinda of spam i have to say).

So no.

If the program version are inconsistant with the version.txt. The updater are supposed to create a independent lockfile to fix version by file chksum, which is not implemented yet now.

Is the program version you pointed out here meaning cli's clash-rs -v output?

If so,that's possible to do.

@greenhat616
Copy link
Collaborator

we might use the cargo set-version from cargo-edit to make the consistent with the version.txt?

I think we do not need to commit the changes after modify the version for alpha build, because we don't release a real alpha tag in github like other well-known repos do.

If the program version are inconsistant with the version.txt. The updater are supposed to create a independent lockfile to fix version by file chksum, which is not implemented yet now.

Is the program version you pointed out here meaning cli's clash-rs -v output?

If so,that's possible to do.

Yes

@Itsusinn
Copy link
Member Author

Itsusinn commented Sep 19, 2024

I think we do not need to commit the changes after modify the version for alpha build, because we don't release a real alpha tag in github like other well-known repos do.

Very good thinking! But it still makes action more complex, we have to do these things in every target:

  • Parse current version from Cargo.toml
  • Get short SHA from git
  • Install cargo-edit by cargo install (another few minutes)
  • Join vars, and cargo set new-version

I would prefer add a environment called VERSION_OVERRIDE
And in cli process:

let version = match env!(VERSION_OVERRIDE) {
    Some(v) -> v
    None -> env!(CARGO_PKG_VERSION)
}

Now new version (.txt) format in my mind: 0.x.y-alpha+sha.0000000

@greenhat616
Copy link
Collaborator

I think we do not need to commit the changes after modify the version for alpha build, because we don't release a real alpha tag in github like other well-known repos do.

Very good thinking!

Now new version (.txt) format in my mind: 0.x.y-alpha+sha.0000000

Yeah. That's enough.

@ibigbug
Copy link
Member

ibigbug commented Sep 19, 2024

Yeah let's also change the cli version output for the nightly release to make it aligned

@greenhat616
Copy link
Collaborator

I think we do not need to commit the changes after modify the version for alpha build, because we don't release a real alpha tag in github like other well-known repos do.

Very good thinking! But it still makes action more complex, we have to do these things in every target:

* Parse current version from `Cargo.toml`

* Get short SHA from `git`

* Install `cargo-edit` by `cargo install` (another few minutes)

* Join vars, and `cargo set new-version`

I would prefer add a environment called VERSION_OVERRIDE And in cli process:

let version = match env!(VERSION_OVERRIDE) {
    Some(v) -> v
    None -> env!(CARGO_PKG_VERSION)
}

Now new version (.txt) format in my mind: 0.x.y-alpha+sha.0000000

Yeah. If we use the cargo-edit, we'd better use cargo-binstall to install it.

And the build envs var is a good way too.

@Itsusinn Itsusinn force-pushed the ci/add-sha512sum-version branch from 3d2170b to 0999a57 Compare September 19, 2024 11:53
clash/src/main.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@greenhat616 greenhat616 left a comment

Choose a reason for hiding this comment

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

LGTM

.github/workflows/ci.yml Show resolved Hide resolved
clash/build.rs Show resolved Hide resolved
@Itsusinn Itsusinn merged commit e8345a3 into master Sep 19, 2024
24 checks passed
@Itsusinn Itsusinn deleted the ci/add-sha512sum-version branch September 19, 2024 15:13
@Itsusinn
Copy link
Member Author

It seems broken......

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