Skip to content

Commit

Permalink
add 32-bit Windows packaging task and steps
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinschopf authored and shiftkey committed Aug 13, 2018
1 parent 55551e8 commit dd33e1e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
13 changes: 11 additions & 2 deletions .travis.yml
Expand Up @@ -29,10 +29,20 @@ matrix:
language: c
env:
- TARGET_PLATFORM=win32
- WIN_ARCH=64
- GIT_FOR_WINDOWS_URL=https://github.com/git-for-windows/git/releases/download/v2.18.0.windows.1/MinGit-2.18.0-64-bit.zip
- GIT_FOR_WINDOWS_CHECKSUM=1dfd05de1320d57f448ed08a07c0b9de2de8976c83840f553440689b5db6a1cf
- GIT_LFS_CHECKSUM=452375d3968491520df29cde989164c41c1c4ff12ba30dfb343872f6d24016f1

- os: linux
language: c
env:
- TARGET_PLATFORM=win32
- WIN_ARCH=32
- GIT_FOR_WINDOWS_URL=https://github.com/git-for-windows/git/releases/download/v2.18.0.windows.1/MinGit-2.18.0-32-bit.zip
- GIT_FOR_WINDOWS_CHECKSUM=c2f59c121d0f5aac31c959e5ba2878542b6cbca6604778566061d45585e70895
- GIT_LFS_CHECKSUM=408f95d919037b068318cb2affb450c17a46915fe6b3d9b10dfc15dc0df15bca

- os: linux
language: go
env:
Expand All @@ -42,8 +52,7 @@ compiler:
- gcc

script:
- script/build.sh
- script/package.sh
- script/build.sh && script/package.sh

branches:
only:
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Expand Up @@ -5,6 +5,7 @@ skip_branch_with_pr: true

environment:
TARGET_PLATFORM: win32
WIN_ARCH: 64
GIT_FOR_WINDOWS_URL: https://github.com/git-for-windows/git/releases/download/v2.18.0.windows.1/MinGit-2.18.0-64-bit.zip
GIT_FOR_WINDOWS_CHECKSUM: 1dfd05de1320d57f448ed08a07c0b9de2de8976c83840f553440689b5db6a1cf
GIT_LFS_VERSION: 2.5.0
Expand Down
17 changes: 10 additions & 7 deletions script/build-win32.sh
Expand Up @@ -22,7 +22,9 @@ computeChecksum() {
DESTINATION=$1
mkdir -p $DESTINATION

echo "-- Downloading MinGit"
if [ "$WIN_ARCH" -eq "64" ]; then MINGW_DIR="mingw64"; else MINGW_DIR="mingw32"; fi

echo "-- Downloading MinGit from $GIT_FOR_WINDOWS_URL"
GIT_FOR_WINDOWS_FILE=git-for-windows.zip
curl -sL -o $GIT_FOR_WINDOWS_FILE $GIT_FOR_WINDOWS_URL
COMPUTED_SHA256=$(computeChecksum $GIT_FOR_WINDOWS_FILE)
Expand All @@ -38,13 +40,14 @@ fi
# download Git LFS, verify its the right contents, and unpack it
echo "-- Bundling Git LFS"
GIT_LFS_FILE=git-lfs.zip
GIT_LFS_URL="https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-windows-amd64-v${GIT_LFS_VERSION}.zip"
if [ "$WIN_ARCH" -eq "64" ]; then GIT_LFS_ARCH="amd64"; else GIT_LFS_ARCH="386"; fi
GIT_LFS_URL="https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-windows-${GIT_LFS_ARCH}-v${GIT_LFS_VERSION}.zip"
echo "-- Downloading from $GIT_LFS_URL"
curl -sL -o $GIT_LFS_FILE $GIT_LFS_URL
COMPUTED_SHA256=$(computeChecksum $GIT_LFS_FILE)
if [ "$COMPUTED_SHA256" = "$GIT_LFS_CHECKSUM" ]; then
echo "Git LFS: checksums match"
SUBFOLDER="$DESTINATION/mingw64/libexec/git-core"
SUBFOLDER="$DESTINATION/$MINGW_DIR/libexec/git-core"
unzip -j $GIT_LFS_FILE -x '*.md' -d $SUBFOLDER

if [[ ! -f "$SUBFOLDER/git-lfs.exe" ]]; then
Expand All @@ -58,7 +61,7 @@ else
exit 1
fi

SYSTEM_CONFIG="$DESTINATION/mingw64/etc/gitconfig"
SYSTEM_CONFIG="$DESTINATION/$MINGW_DIR/etc/gitconfig"

echo "-- Setting some system configuration values"
git config --file $SYSTEM_CONFIG core.symlinks "false"
Expand All @@ -81,9 +84,9 @@ git config --file $SYSTEM_CONFIG --unset http.sslCAInfo
git config --file $SYSTEM_CONFIG http.schannelUseSSLCAInfo "false"

# removing global gitattributes file
rm "$DESTINATION/mingw64/etc/gitattributes"
rm "$DESTINATION/$MINGW_DIR/etc/gitattributes"
echo "-- Removing global gitattributes which handles certain file extensions"

rm "$DESTINATION/mingw64/bin/git-credential-store.exe"
rm "$DESTINATION/mingw64/bin/git-credential-wincred.exe"
rm "$DESTINATION/$MINGW_DIR/bin/git-credential-store.exe"
rm "$DESTINATION/$MINGW_DIR/bin/git-credential-wincred.exe"
echo "-- Removing legacy credential helpers"
5 changes: 3 additions & 2 deletions script/package.sh
Expand Up @@ -32,8 +32,9 @@ elif [ "$TARGET_PLATFORM" == "macOS" ]; then
GZIP_FILE="dugite-native-$VERSION-macOS.tar.gz"
LZMA_FILE="dugite-native-$VERSION-macOS.lzma"
elif [ "$TARGET_PLATFORM" == "win32" ]; then
GZIP_FILE="dugite-native-$VERSION-win32.tar.gz"
LZMA_FILE="dugite-native-$VERSION-win32.lzma"
if [ "$WIN_ARCH" -eq "64" ]; then ARCH="x64"; else ARCH="x86"; fi
GZIP_FILE="dugite-native-$VERSION-windows-$ARCH.tar.gz"
LZMA_FILE="dugite-native-$VERSION-windows-$ARCH.lzma"
elif [ "$TARGET_PLATFORM" == "arm64" ]; then
GZIP_FILE="dugite-native-$VERSION-arm64.tar.gz"
LZMA_FILE="dugite-native-$VERSION-arm64.lzma"
Expand Down

0 comments on commit dd33e1e

Please sign in to comment.