Version sanity check (#2294)

This commit is contained in:
Jamil
2023-10-10 09:13:09 -07:00
committed by GitHub
parent dbb4a4c5a0
commit f53a40c653
2 changed files with 33 additions and 5 deletions

View File

@@ -3,7 +3,29 @@ on:
workflow_call:
jobs:
static-analysis_linter:
version-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check version is up to date
run: |
make version
if [ -z "$(git status --porcelain)" ]; then
# Working directory clean
echo "Version manifests up to date"
else
# Uncommitted changes
echo '`make version` found outdated files! Showing diff'
git diff
exit 1
fi
global-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

View File

@@ -7,11 +7,17 @@ version = 1.20231001.0
.PHONY: version
ifeq ($(shell uname),Darwin)
SEDARG := -i ''
else
SEDARG := -i
endif
version:
# Elixir can set its Application version from a file, but other components aren't so flexible.
@echo $(version) > elixir/VERSION
@find rust/ -name "Cargo.toml" -exec sed -i '' -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(version)/;}' {} \;
@find .github/ -name "*.yml" -exec sed -i '' -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(version)/;}' {} \;
@find swift/ -name "project.pbxproj" -exec sed -i '' -e 's/MARKETING_VERSION = .*;/MARKETING_VERSION = $(version);/' {} \;
@find kotlin/ -name "build.gradle.kts" -exec sed -i '' -e '/mark:automatic-version/{n;s/versionName =.*/versionName = "$(version)"/;}' {} \;
@find rust/ -name "Cargo.toml" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(version)/;}' {} \;
@find .github/ -name "*.yml" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(version)/;}' {} \;
@find swift/ -name "project.pbxproj" -exec sed $(SEDARG) -e 's/MARKETING_VERSION = .*;/MARKETING_VERSION = $(version);/' {} \;
@find kotlin/ -name "build.gradle.kts" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/versionName =.*/versionName = "$(version)"/;}' {} \;
@cd rust && cargo check