Skip to content

Commit

Permalink
Take version from Cargo workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
kiron1 committed Nov 25, 2023
1 parent f0abe61 commit 0bf7d98
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/bump_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ jobs:

- name: Bump version of proxydetox
run: |
cargo set-version -p proxydetox --bump ${{ github.event.inputs.release_kind }}
- name: Bump version of proxydetoxlib
run: |
cargo set-version -p proxydetoxlib --bump ${{ github.event.inputs.release_kind }}
cargo set-version --bump ${{ github.event.inputs.release_kind }}
- name: Cargo update
run: |
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ default-members = [
"spnego",
]

[workspace.package]
version = "0.7.3"
edition = "2021"
homepage = "https://proxydetox.colorto.cc/"

[workspace.dependencies]
base64 = "0.21"
boa_engine = { version = "0.17", features = ["annex-b"] }
Expand Down
4 changes: 2 additions & 2 deletions proxydetox/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "proxydetox"
version = "0.7.3"
version.workspace = true
edition = "2021"
homepage = "https://proxydetox.colorto.cc/"
homepage.workspace = true

[features]
default = ["negotiate"]
Expand Down
4 changes: 2 additions & 2 deletions proxydetoxlib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "proxydetoxlib"
version = "0.7.3"
version.workspace = true
edition = "2021"
homepage = "https://proxydetox.colorto.cc/"
homepage.workspace = true

[features]
default = ["negotiate"]
Expand Down
6 changes: 3 additions & 3 deletions tools/mkdeb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ cargo install \
sed -e "s|\${prefix}|${prefix}|" "${root}/debian/proxydetox.service" \
>"${workdir}/lib/systemd/user/proxydetox.service"

version=$(sed -n 's/^version\s*=\s*"\([0-9.]*\)"/\1/p' "${root}/proxydetox/Cargo.toml")
echo "version=${version}" >> "${GITHUB_OUTPUT:-/dev/stdout}"
version=$("${root}/tools/version")
echo "version=${version}" | tee -a "${GITHUB_OUTPUT:-/dev/stdout}"

pkgfile=proxydetox-${version}-x86_64-${distname}.deb
echo "pkgfile=${pkgfile}" >> "${GITHUB_OUTPUT:-/dev/stdout}"
echo "pkgfile=${pkgfile}" | tee -a "${GITHUB_OUTPUT:-/dev/stdout}"

sed -e "s/\${version}/${version}/" "${root}/debian/control" >"${workdir}/DEBIAN/control"
for f in postinst postrm; do
Expand Down
6 changes: 3 additions & 3 deletions tools/mkpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ install -v -m 0644 "${root}/pkg/macos/40-proxydetox" "${workdir}/etc/paths.d/"
install -d "${workdir}/${prefix}/libexec/"
install -v "${setproxy_helper}" "${workdir}/${prefix}/libexec/setproxy_helper"

version=$(sed -n 's/^version[ \t]*=[ \t]*"\([0-9.]*\)"/\1/p' "${root}/proxydetox/Cargo.toml")
version=$("${root}/tools/version")
pkgfile=proxydetox-${version}-${arch}-apple-darwin.pkg
echo "version=${version}" >> "${GITHUB_OUTPUT:-/dev/stdout}"
echo "pkgfile=${pkgfile}" >> "${GITHUB_OUTPUT:-/dev/stdout}"
echo "version=${version}" | tee -a "${GITHUB_OUTPUT:-/dev/stdout}"
echo "pkgfile=${pkgfile}" | tee -a "${GITHUB_OUTPUT:-/dev/stdout}"

echo "Building ${pkgfile}"
pkgbuild \
Expand Down

0 comments on commit 0bf7d98

Please sign in to comment.