mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Version sanity check (#2294)
This commit is contained in:
24
.github/workflows/static-analysis.yml
vendored
24
.github/workflows/static-analysis.yml
vendored
@@ -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
|
||||
|
||||
14
Makefile
14
Makefile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user