[internal] update hooks to remove automated tagging

* Also update AppVeyor builds wrt the above
This commit is contained in:
Pete Batard 2018-10-19 14:34:34 +01:00
parent bc6e23ec11
commit 6d7a938058
5 changed files with 16 additions and 54 deletions

View File

@ -1,19 +0,0 @@
#!/bin/sh
#
# Creates a tag according to the number of commits on this branch
#
# To have git run this script on commit, create a "post-commit" text file in
# .git/hooks/ with the following content:
# #!/bin/sh
# if [ -x ./_post-commit.sh ]; then
# . ./_post-commit.sh
# fi
type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1; }
TAGVER=`cat ./.tag`
# Only apply a tag if we're dealing with the master branch
if [ "`git rev-parse --abbrev-ref HEAD`" == "master" ]; then
git tag "b$TAGVER"
fi
rm ./.tag

View File

@ -16,28 +16,26 @@ if [ -x ./_detect-amend.sh ]; then
. ./_detect-amend.sh
fi
TAGVER=`git rev-list HEAD --count`
BUILD=`git rev-list HEAD --count`
# adjust so that we match the github commit count
((TAGVER++))
((BUILD++))
# there may be a better way to prevent improper micro on amend. For now the detection
# of a .amend file in the current directory will do
if [ -f ./.amend ]; then
((TAGVER--))
git tag -d "b$TAGVER"
((BUILD--))
rm ./.amend;
fi
echo "setting micro to $TAGVER"
echo $TAGVER > .tag
echo "setting micro to $BUILD"
cat > cmd.sed <<\_EOF
s/^\([ \t]*\)*\(FILE\|PRODUCT\)VERSION\([ \t]*\)\([0-9]*\),\([0-9]*\),[0-9]*,\(.*\)/\1\2VERSION\3\4,\5,@@TAGVER@@,\6/
s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"\(.*\)\..*"[ \t]*/\1VALUE\2"\3Version",\4"\5.@@TAGVER@@"/
s/^\(.*\)"Rufus \(.*\)\..*"\(.*\)/\1"Rufus \2.@@TAGVER@@"\3/
s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@TAGVER@@.\4"\5/
s/^\([ \t]*\)*\(FILE\|PRODUCT\)VERSION\([ \t]*\)\([0-9]*\),\([0-9]*\),[0-9]*,\(.*\)/\1\2VERSION\3\4,\5,@@BUILD@@,\6/
s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"\(.*\)\..*"[ \t]*/\1VALUE\2"\3Version",\4"\5.@@BUILD@@"/
s/^\(.*\)"Rufus \(.*\)\..*"\(.*\)/\1"Rufus \2.@@BUILD@@"\3/
s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@BUILD@@.\4"\5/
_EOF
# First run sed to substitute our variable in the sed command file
sed -i -e "s/@@TAGVER@@/$TAGVER/g" cmd.sed
sed -i -e "s/@@BUILD@@/$BUILD/g" cmd.sed
# Run sed to update the nano version
sed -b -i -f cmd.sed src/rufus.rc
# NB: we need to run git add else the modified files may be ignored

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Sets the git hooks on a new git development system
if [ -e ".git/hooks/pre-commit" ] || [ -e ".git/hooks/post-commit" ] ; then
echo 'pre-commit or post-commit git hook is already set, aborting.'
if [ -e ".git/hooks/pre-commit" ]; then
echo 'pre-commit git hook is already set, aborting.'
exit
fi
@ -10,9 +10,3 @@ echo '#!/bin/sh' > .git/hooks/pre-commit
echo 'if [ -x ./_pre-commit.sh ]; then' >> .git/hooks/pre-commit
echo ' . ./_pre-commit.sh' >> .git/hooks/pre-commit
echo 'fi' >> .git/hooks/pre-commit
echo 'Creating post-commit git hook...'
echo '#!/bin/sh' > .git/hooks/post-commit
echo 'if [ -x ./_post-commit.sh ]; then' >> .git/hooks/post-commit
echo ' . ./_post-commit.sh' >> .git/hooks/post-commit
echo 'fi' >> .git/hooks/post-commit

View File

@ -1,8 +1,5 @@
os: Visual Studio 2017
# May choose to enable the following if we get tired of seeing double AppVeyor builds for tagged and untagged
# skip_non_tags: true
skip_commits:
# Don't run AppVeyor for commits that only modify resource or non-code files
files:
@ -55,10 +52,6 @@ init:
Update-AppveyorBuild -Version "$($env:APPVEYOR_REPO_TAG_NAME)_#$env:APPVEYOR_BUILD_NUMBER";
} else {
Update-AppveyorBuild -Version "dev-$($env:APPVEYOR_REPO_COMMIT.Substring(0,8))_#$env:APPVEYOR_BUILD_NUMBER";
if ("$env:APPVEYOR_REPO_NAME" -eq "pbatard/rufus" -and "$env:APPVEYOR_REPO_BRANCH" -eq "master") {
Write-Output "Not running dev-build since we expect a tagged commit.";
Exit-AppVeyorBuild;
}
}
build:
@ -88,10 +81,6 @@ build_script:
Write-Output "Not running Coverity due to missing credential.";
return;
}
if ($env:APPVEYOR_REPO_TAG -eq "false") {
Write-Output "Not running Coverity due to missing tag.";
return;
}
& nuget install PublishCoverity -o "$env:APPVEYOR_BUILD_FOLDER" -excludeversion;
& cov-build.exe --dir cov-int msbuild rufus.sln /m /p:Configuration=$env:CONFIGURATION,Platform=$env:PLATFORM /l:$APPVEYOR_LOGGER;
& $PUBLISHCOVERITY compress --nologo -i "$env:APPVEYOR_BUILD_FOLDER\cov-int" -o "$env:APPVEYOR_BUILD_FOLDER\coverity.zip" --overwrite;

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.4.1408"
CAPTION "Rufus 3.4.1409"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -392,8 +392,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,4,1408,0
PRODUCTVERSION 3,4,1408,0
FILEVERSION 3,4,1409,0
PRODUCTVERSION 3,4,1409,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -411,13 +411,13 @@ BEGIN
VALUE "Comments", "https://akeo.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.4.1408"
VALUE "FileVersion", "3.4.1409"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus-3.4.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.4.1408"
VALUE "ProductVersion", "3.4.1409"
END
END
BLOCK "VarFileInfo"