Skip to content

Commit

Permalink
Add scrip/get-version script
Browse files Browse the repository at this point in the history
Previous way wasn't working and this way we edit one less file when
pushing new versions.
  • Loading branch information
jpsim committed Nov 23, 2020
1 parent f0f0086 commit be21dc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LICENSE_PATH="$(shell pwd)/LICENSE"

OUTPUT_PACKAGE=SwiftLint.pkg

VERSION_STRING=0.41.0
VERSION_STRING="$(shell ./script/get-version)"

.PHONY: all clean build install package test uninstall docs

Expand Down Expand Up @@ -153,7 +153,6 @@ endif
$(eval NEW_VERSION := $(shell echo $(NEW_VERSION_AND_NAME) | sed 's/:.*//' ))
@sed -i '' 's/## Master/## $(NEW_VERSION_AND_NAME)/g' CHANGELOG.md
@sed 's/__VERSION__/$(NEW_VERSION)/g' script/Version.swift.template > Source/SwiftLintFramework/Models/Version.swift
@sed -i '' 's/VERSION_STRING.*/VERSION_STRING=$(NEW_VERSION)/g' Makefile
git commit -a -m "release $(NEW_VERSION)"
git tag -a $(NEW_VERSION) -m "$(NEW_VERSION_AND_NAME)"
git push origin master
Expand Down
5 changes: 5 additions & 0 deletions script/get-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -euo pipefail

cat Source/SwiftLintFramework/Models/Version.swift | awk -F '"' '{print $2}' | xargs

0 comments on commit be21dc3

Please sign in to comment.