Files
firezone/scripts/Makefile
Jamil 539431d9a3 chore(ci): Allow versioning components separately (#4493)
Since we already have apps published, we need the ability to decouple
the versions of components from each other so that we can run CI and
publish them independently.

This is the first step. The next step would be decoupling releases so
that they're for individual components.

refs #4397
2024-04-11 13:38:03 +00:00

38 lines
1.4 KiB
Makefile

# Format: Semver
# See discussion here: https://github.com/firezone/firezone/issues/2041
# and PR changing it here: https://github.com/firezone/firezone/pull/2949
apple-version = 1.0.1
android-version = 1.0.0
cargo-version = 1.0.0
elixir-version = 1.0.0
ci-version = 1.0.0
.PHONY: version apple-version android-version cargo-version ci-version elixir-version
ifeq ($(shell uname),Darwin)
SEDARG := -i ''
else
SEDARG := -i
endif
apple-version:
@find swift/ -name "project.pbxproj" -exec sed $(SEDARG) -e 's/MARKETING_VERSION = .*;/MARKETING_VERSION = $(apple-version);/' {} \;
android-version:
@find kotlin/ -name "*.gradle.kts" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/versionName =.*/versionName = "$(android-version)"/;}' {} \;
cargo-version:
@find rust/ -name "Cargo.toml" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(rust-version)/;}' {} \;
# TODO: This can fail on some platforms. You may need to specify the package
# to avoid hitting the wrong codepaths for your platform.
@cd rust && cargo check
ci-version:
@find .github/ -name "*.yml" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(ci-version)/;}' {} \;
elixir-version:
@# Elixir can set its Application version from a file, but other components aren't so flexible.
@echo $(elixir-version) > elixir/VERSION
version: apple-version android-version cargo-version ci-version elixir-version