From 078425191dd3bdc48142ad1b5d3a0cbca087eb11 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Wed, 27 Mar 2024 14:34:38 +0700 Subject: [PATCH] Update mercurial version (#333) * update lib chorus version to use mercurial 6 * update base images to use python3 and dotnet 8 * Also update LfMergeBridge version * Switch build to use .NET 8.0 instead of 6.0 * Update ChorusMerge to version with net8.0 build * LfMerge Dockerfile should be based on .NET 8 now * New GHA workflow for simpler dotnet build This workflow uses `dotnet test` and `dotnet build` steps directly in the GHA runner, rather than building an LfMerge builder image. That way it's a lot easier to understand the build process, and to replicate it on dev machines (just do `dotnet build` and `dotnet test`). * Have pbuild.sh script tag builds with branch name This will allow us to more easily run a local build and deploy it to local LF for testing, without having to wait for a GHA workflow. --------- Co-authored-by: Robin Munn --- .../{docker-build.yml => dotnet-build.yml} | 77 +++++++++++-------- .github/workflows/release.yml | 20 ++++- Dockerfile.builder-base | 4 +- Dockerfile.finalresult | 10 ++- Dockerfile.runtime-base | 4 +- LfMerge.TestApp/LfMerge.TestApp.csproj | 2 +- docker/scripts/build-and-test.sh | 4 +- docker/scripts/create-installation-tarball.sh | 28 ++++++- docker/scripts/get-version-number.sh | 4 + environ | 2 +- pbuild.sh | 44 ++--------- src/FixFwData/FixFwData.csproj | 2 +- .../LfMerge.Core.Tests.csproj | 27 +++++-- src/LfMerge.Core/LfMerge.Core.csproj | 22 ++++-- src/LfMerge.Tests/LfMerge.Tests.csproj | 6 +- src/LfMerge/LfMerge.csproj | 2 +- src/LfMergeAuxTool/LfMergeAuxTool.csproj | 2 +- .../LfMergeQueueManager.csproj | 2 +- 18 files changed, 157 insertions(+), 105 deletions(-) rename .github/workflows/{docker-build.yml => dotnet-build.yml} (50%) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/dotnet-build.yml similarity index 50% rename from .github/workflows/docker-build.yml rename to .github/workflows/dotnet-build.yml index b01e1d8b..35206168 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -1,4 +1,4 @@ -name: docker-build +name: dotnet-build on: push: @@ -11,17 +11,17 @@ on: jobs: build: - runs-on: ubuntu-latest + # We won't use ubuntu-latest so that we can control when to switch to the ubuntu-24.04 runner once it comes out + runs-on: ubuntu-22.04 # As of 2022-08-16, we build LfMerge for LCM DB version 72 only (and will expand this to include any future DbVersions) strategy: matrix: dbversion: [7000072] - distro: [ 'bionic' ] steps: - name: Check out current branch - uses: actions/checkout@v3 + uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0 with: fetch-depth: 0 # All history for all tags and branches, since version number script needs that @@ -42,43 +42,47 @@ jobs: TAG: v${{ steps.version.outputs.MsBuildVersion }} VERSION: ${{ steps.version.outputs.MsBuildVersion }} - - name: Set up buildx for Docker - uses: docker/setup-buildx-action@v2.4.1 - - - name: Find current UID + - name: Find current UID and GID id: uid - run: echo "uid=$(id -u)" >> $GITHUB_OUTPUT + run: | + echo "uid=$(id -u)" >> $GITHUB_OUTPUT + echo "gid=$(id -g)" >> $GITHUB_OUTPUT - - name: Output diagnostics + - name: dotnet build + run: dotnet build /property:Configuration=Release /property:DatabaseVersion=${DbVersion} LfMerge.sln + env: + BUILD_NUMBER: ${{ github.run_number }} + DbVersion: ${{ matrix.dbversion }} + DebPackageVersion: ${{ steps.version.outputs.DebPackageVersion }} + MsBuildVersion: ${{ steps.version.outputs.MsBuildVersion }} + MajorMinorPatch: ${{ steps.version.outputs.MajorMinorPatch }} + AssemblySemVer: ${{ steps.version.outputs.AssemblySemVer }} + AssemblySemFileVer: ${{ steps.version.outputs.AssemblySemFileVer }} + InformationalVersion: ${{ steps.version.outputs.InformationalVersion }} + + - name: Set up required directories for dotnet test run: | - echo "the developer is = ${{steps.uid.outputs.developer}}" - - - name: Build DBVersion-specific Docker image - uses: docker/build-push-action@v4.0.0 - with: - push: false - load: true - tags: lfmerge-build-${{matrix.dbversion}} - context: . - cache-from: type=gha - cache-to: type=gha,mode=max - build-args: | - DbVersion=${{matrix.dbversion}} - BUILDER_UID=${{steps.uid.outputs.uid}} - - - name: Run docker image ls to verify build - run: docker image ls - - - name: Run the build container + sudo mkdir -p /usr/lib/lfmerge/${DbVersion} /var/lib/languageforge/lexicon/sendreceive/{Templates,state,editqueue,syncqueue,webwork} + sudo chown -R ${uid}:${gid} /usr/lib/lfmerge /var/lib/languageforge/lexicon/sendreceive + env: + DbVersion: ${{ matrix.dbversion }} + uid: ${{ steps.uid.outputs.uid }} + gid: ${{ steps.uid.outputs.gid }} + + - name: dotnet test + run: | + source environ + dotnet test -l:"console;verbosity=normal" -l:nunit -c Release env: BUILD_NUMBER: ${{ github.run_number }} + DbVersion: ${{ matrix.dbversion }} + VSTEST_TESTHOST_SHUTDOWN_TIMEOUT: "30000" DebPackageVersion: ${{ steps.version.outputs.DebPackageVersion }} MsBuildVersion: ${{ steps.version.outputs.MsBuildVersion }} MajorMinorPatch: ${{ steps.version.outputs.MajorMinorPatch }} AssemblySemVer: ${{ steps.version.outputs.AssemblySemVer }} AssemblySemFileVer: ${{ steps.version.outputs.AssemblySemFileVer }} InformationalVersion: ${{ steps.version.outputs.InformationalVersion }} - run: docker run --mount type=bind,source="$(pwd)",target=/home/builder/repo --env "BUILD_NUMBER=${BUILD_NUMBER}" --env "DebPackageVersion=${DebPackageVersion}" --env "Version=${MsBuildVersion}" --env "MajorMinorPatch=${MajorMinorPatch}" --env "AssemblyVersion=${AssemblySemVer}" --env "FileVersion=${AssemblySemFileVer}" --env "InformationalVersion=${InformationalVersion}" --name tmp-lfmerge-build-${{matrix.dbversion}} lfmerge-build-${{matrix.dbversion}} - name: Report test results uses: EnricoMi/publish-unit-test-result-action@v2.3.0 @@ -86,13 +90,20 @@ jobs: with: nunit_files: "**/TestResults/TestResults.xml" + - name: Prepare build output for installation tarball + run: docker/scripts/create-installation-tarball.sh ${DbVersion} + env: + DbVersion: ${{ matrix.dbversion }} + + # actions/upload-artifact creates .zip files which do not preserve Unix file permissions, so we need to create a tarball - name: Compress tarball images for faster uploads - run: time (tar cf - tarball | gzip -c9 > tarball.tar.gz) + run: time (tar cf - tarball | gzip -c > tarball.tar.gz) - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: lfmerge-tarball + name: lfmerge-tarball-${{ matrix.dbversion }} path: tarball.tar.gz + compression-level: 0 # Already compressed in previous step outputs: MsBuildVersion: ${{ steps.output_version_number.outputs.VersionFor7000072 }} TagFor7000072: ${{ steps.output_version_number.outputs.TagFor7000072 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9c82000..9ef78495 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0 with: fetch-depth: 0 @@ -37,7 +37,6 @@ jobs: - name: Calculate Docker tags id: docker_tag - if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') env: MS_BUILD_VERSION: ${{ inputs.MsBuildVersion }} run: | @@ -50,7 +49,7 @@ jobs: echo "DockerTags=${TAGS}" >> $GITHUB_OUTPUT - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: # No name specified, so will download all artifacts path: all-tarballs @@ -89,3 +88,18 @@ jobs: - name: List Docker images to verify build run: docker image ls + # During development, we'll want the Docker image as a build artifact + - name: Save Docker image to tarball + if: (!(github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'))) + run: docker image save "${TAG}" -o "lfmerge-${MS_BUILD_VERSION}.tar" + env: + MS_BUILD_VERSION: ${{ inputs.MsBuildVersion }} + TAG: ghcr.io/sillsdev/lfmerge:${{ inputs.MsBuildVersion }} + + - name: Upload Docker image as build artifact + if: (!(github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'))) + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: lfmerge-docker-${{ inputs.MsBuildVersion }} + path: lfmerge-${{ inputs.MsBuildVersion }}.tar + compression-level: 6 diff --git a/Dockerfile.builder-base b/Dockerfile.builder-base index 7a32f2e4..59aa2f96 100644 --- a/Dockerfile.builder-base +++ b/Dockerfile.builder-base @@ -1,13 +1,13 @@ ARG DbVersion=7000072 -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS lfmerge-builder-base +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS lfmerge-builder-base WORKDIR /build/lfmerge ENV DEBIAN_FRONTEND=noninteractive ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 # Dependencies from Debian "control" file -RUN apt-get update && apt-get install -y curl sudo iputils-ping cpp python-is-python2 python2-dev pkg-config libicu-dev && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y curl sudo iputils-ping cpp python-is-python3 python3-dev pkg-config libicu-dev && rm -rf /var/lib/apt/lists/* # Ensure fieldworks group exists in case lfmerge-fdo package didn't install it, and that www-data is part of that group # Also ensure that www-data has a .local dir in its home directory (/var/www) since some of lfmerge's dependencies assume that $HOME/.local exists diff --git a/Dockerfile.finalresult b/Dockerfile.finalresult index f5a52356..a12cb0f8 100644 --- a/Dockerfile.finalresult +++ b/Dockerfile.finalresult @@ -1,7 +1,13 @@ # syntax=docker/dockerfile:experimental ARG DbVersion=7000072 -FROM ghcr.io/sillsdev/lfmerge-base:runtime +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS lfmerge-builder-base + +# Ensure fieldworks group exists in case lfmerge-fdo package didn't install it, and that www-data is part of that group +# Also ensure that www-data has a .local dir in its home directory (/var/www) since some of lfmerge's dependencies assume that $HOME/.local exists +RUN addgroup --system --quiet fieldworks ; \ + adduser --quiet www-data fieldworks ; \ + install -d -o www-data -g www-data -m 02775 /var/www/.local/share # install LFMerge prerequisites # tini - PID 1 handler @@ -10,7 +16,7 @@ FROM ghcr.io/sillsdev/lfmerge-base:runtime # less - so we can read syslog during manual debugging of issues # vim-tiny - so we can edit state files (to change HOLD to IDLE) during manual debugging of issues RUN apt-get update \ - && apt-get install --yes --no-install-recommends tini python iputils-ping inotify-tools less vim-tiny \ + && apt-get install --yes --no-install-recommends tini python-is-python3 sudo iputils-ping inotify-tools less vim-tiny \ && rm -rf /var/lib/apt/lists/* ADD tarball/lfmerge* / diff --git a/Dockerfile.runtime-base b/Dockerfile.runtime-base index 3d1406a7..15e62e68 100644 --- a/Dockerfile.runtime-base +++ b/Dockerfile.runtime-base @@ -1,13 +1,13 @@ ARG DbVersion=7000072 -FROM mcr.microsoft.com/dotnet/runtime:6.0 AS lfmerge-builder-base +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS lfmerge-builder-base WORKDIR /build/lfmerge ENV DEBIAN_FRONTEND=noninteractive ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 # Dependencies from Debian "control" file -RUN apt-get update && apt-get install -y curl sudo iputils-ping cpp python-is-python2 python2-dev pkg-config libicu-dev && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y curl sudo iputils-ping cpp python-is-python3 python3-dev pkg-config libicu-dev && rm -rf /var/lib/apt/lists/* # Ensure fieldworks group exists in case lfmerge-fdo package didn't install it, and that www-data is part of that group # Also ensure that www-data has a .local dir in its home directory (/var/www) since some of lfmerge's dependencies assume that $HOME/.local exists diff --git a/LfMerge.TestApp/LfMerge.TestApp.csproj b/LfMerge.TestApp/LfMerge.TestApp.csproj index f28611ed..3340fd07 100644 --- a/LfMerge.TestApp/LfMerge.TestApp.csproj +++ b/LfMerge.TestApp/LfMerge.TestApp.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Exe LfMerge.TestApp Debug;Release diff --git a/docker/scripts/build-and-test.sh b/docker/scripts/build-and-test.sh index 724c97cb..77c97594 100755 --- a/docker/scripts/build-and-test.sh +++ b/docker/scripts/build-and-test.sh @@ -8,7 +8,7 @@ SCRIPT_DIR=$(dirname $(readlink -f "$0")) export DbVersion="${1-7000072}" echo "Building for ${DbVersion}" -sudo mkdir -p /usr/lib/lfmerge/${DbVersion} +[ -d "/usr/lib/lfmerge/${DbVersion}" ] || sudo mkdir -p /usr/lib/lfmerge/${DbVersion} echo Running as $(id) # Assuming script is being run from inside the repo, find the repo root and use that as the working directory from now on @@ -25,7 +25,7 @@ dotnet restore -v:m echo "Compiling LfMerge" dotnet build --no-restore /v:m /property:Configuration=Release /property:DatabaseVersion=${DbVersion} LfMerge.sln -if [ -n "$RUN_UNIT_TESTS" -a "$RUN_UNIT_TESTS" -ne 0 ]; then +if [ -n "$RUN_UNIT_TESTS" ] && [ "$RUN_UNIT_TESTS" -ne 0 ]; then echo "Running unit tests" # dotnet test defaults to killing test processes after 100ms, which is way too short export VSTEST_TESTHOST_SHUTDOWN_TIMEOUT=30000 # 30 seconds, please, since some of our tests can run very long diff --git a/docker/scripts/create-installation-tarball.sh b/docker/scripts/create-installation-tarball.sh index 900ef90a..541e932a 100755 --- a/docker/scripts/create-installation-tarball.sh +++ b/docker/scripts/create-installation-tarball.sh @@ -8,7 +8,7 @@ set -e export HOME=/tmp export XDG_CONFIG_HOME=/tmp/.config export BUILD=Release -export FRAMEWORK=net6.0 +export FRAMEWORK=net8.0 export NETSTANDARD=netstandard2.0 export DatabaseVersion=${1:-7000072} @@ -53,26 +53,48 @@ install -m 755 output/${BUILD}/${FRAMEWORK}/LfMergeQueueManager ${DBDESTDIR}/${L install -m 755 output/${BUILD}/${FRAMEWORK}/chorusmerge ${DBDESTDIR}/${LIB} 2>/dev/null || install -m 755 output/${BUILD}/chorusmerge ${DBDESTDIR}/${LIB} chmod 755 ${DBDESTDIR}/${LIB}/FixFwData.exe install -d ${DBDESTDIR}/${LIB}/Mercurial +install -d ${DBDESTDIR}/${LIB}/Mercurial/hgdemandimport install -d ${DBDESTDIR}/${LIB}/Mercurial/hgext install -d ${DBDESTDIR}/${LIB}/Mercurial/hgext/convert install -d ${DBDESTDIR}/${LIB}/Mercurial/hgext/highlight install -d ${DBDESTDIR}/${LIB}/Mercurial/hgext/largefiles install -d ${DBDESTDIR}/${LIB}/Mercurial/hgext/zeroconf install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/dirstateutils install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/hgweb -install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/httpclient +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/httpclient || true +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/interfaces +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/pure +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/revlogutils +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/stabletailgraph +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/testing +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/thirdparty +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/thirdparty/attr +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/utils +install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/upgrade_utils install -d ${DBDESTDIR}/${LIB}/MercurialExtensions install -d ${DBDESTDIR}/${LIB}/MercurialExtensions/fixutf8 install -m 755 Mercurial/hg ${DBDESTDIR}/${LIB}/Mercurial install -m 644 Mercurial/mercurial.ini ${DBDESTDIR}/${LIB}/Mercurial +install -m 644 Mercurial/hgdemandimport/*.* ${DBDESTDIR}/${LIB}/Mercurial/hgdemandimport install -m 644 Mercurial/hgext/*.* ${DBDESTDIR}/${LIB}/Mercurial/hgext install -m 644 Mercurial/hgext/convert/*.* ${DBDESTDIR}/${LIB}/Mercurial/hgext/convert install -m 644 Mercurial/hgext/highlight/*.* ${DBDESTDIR}/${LIB}/Mercurial/hgext/highlight install -m 644 Mercurial/hgext/largefiles/*.* ${DBDESTDIR}/${LIB}/Mercurial/hgext/largefiles install -m 644 Mercurial/hgext/zeroconf/*.* ${DBDESTDIR}/${LIB}/Mercurial/hgext/zeroconf install -m 644 Mercurial/mercurial/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial +install -m 644 Mercurial/mercurial/dirstateutils/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/dirstateutils install -m 644 Mercurial/mercurial/hgweb/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/hgweb -install -m 644 Mercurial/mercurial/httpclient/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/httpclient +install -m 644 Mercurial/mercurial/httpclient/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/httpclient || true +install -m 644 Mercurial/mercurial/interfaces/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/interfaces +install -m 644 Mercurial/mercurial/pure/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/pure +install -m 644 Mercurial/mercurial/revlogutils/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/revlogutils +install -m 644 Mercurial/mercurial/stabletailgraph/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/stabletailgraph +install -m 644 Mercurial/mercurial/testing/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/testing +install -m 644 Mercurial/mercurial/thirdparty/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/thirdparty +install -m 644 Mercurial/mercurial/thirdparty/attr/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/thirdparty/attr +install -m 644 Mercurial/mercurial/utils/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/utils +install -m 644 Mercurial/mercurial/upgrade_utils/*.* ${DBDESTDIR}/${LIB}/Mercurial/mercurial/upgrade_utils install -m 644 MercurialExtensions/fixutf8/*.* ${DBDESTDIR}/${LIB}/MercurialExtensions/fixutf8 install -d ${DBDESTDIR}/${LIB}/runtimes install -d ${DBDESTDIR}/${LIB}/runtimes/linux-x64 diff --git a/docker/scripts/get-version-number.sh b/docker/scripts/get-version-number.sh index a5586621..53242e2e 100755 --- a/docker/scripts/get-version-number.sh +++ b/docker/scripts/get-version-number.sh @@ -73,6 +73,10 @@ fi GIT_SHA=${GITHUB_SHA:-$(git rev-parse ${REV})} TAG_SUFFIX="$(date +%Y%m%d)-${GIT_SHA}" export InformationalVersion="${MsBuildVersion}${INFO_SUFFIX}:${TAG_SUFFIX}" + +# If not running on GitHub Actions, GITHUB_OUTPUT is empty which would cause "ambiguous redirect" errors below +GITHUB_OUTPUT=${GITHUB_OUTPUT:-/dev/stdout} + echo "Calculated version number ${MsBuildVersion} for ${DbVersion}" echo "DebPackageVersion=${DebPackageVersion}" >> $GITHUB_OUTPUT echo "MsBuildVersion=${MsBuildVersion}" >> $GITHUB_OUTPUT diff --git a/environ b/environ index ff77d0ae..118ac7c1 100644 --- a/environ +++ b/environ @@ -4,7 +4,7 @@ # the sourcing script should cd/pushd to the directory containing this script BASE="$(pwd)" -export PATH="${BASE}/output/${BUILD}/net6.0:${BASE}/output/Mercurial:${PATH}" +export PATH="${BASE}/output/${BUILD}/net8.0:${BASE}/output/Mercurial:${PATH}" # set HGRCPATH so that we ignore ~/.hgrc files which might have content that is # incompatible with our version of Mercurial diff --git a/pbuild.sh b/pbuild.sh index ccaa41cd..aee08866 100755 --- a/pbuild.sh +++ b/pbuild.sh @@ -37,47 +37,15 @@ FW9_BUILD_BRANCH="$(git name-rev --name-only HEAD)" echo Will build ONLY the FW9 build, from "${FW9_BUILD_BRANCH}" # Clean up any previous builds -# This for loop includes all historical DbVersions even if BUILD_FW8 is 0 -for DbVersion in ${HISTORICAL_VERSIONS[@]} ${DBMODEL_VERSIONS[@]}; do - # Can safely ignore "container doesn't exist" as that's not an error - docker container kill tmp-lfmerge-build-${DbVersion} >/dev/null 2>/dev/null || true - docker container rm tmp-lfmerge-build-${DbVersion} >/dev/null 2>/dev/null || true -done - -CURRENT_UID=$(id -u) - -# First create the base build container ONCE (it will be reused as a base by each DbVersion build), which should help with caching -docker build -t ghcr.io/sillsdev/lfmerge-base:sdk -f Dockerfile.builder-base . -docker build -t ghcr.io/sillsdev/lfmerge-base:runtime -f Dockerfile.runtime-base . -docker build --build-arg "BUILDER_UID=${CURRENT_UID}" -t lfmerge-builder-base --target lfmerge-builder-base . - -# Create the build images for each DbVersion -for DbVersion in ${DBMODEL_VERSIONS[@]}; do - docker build --build-arg DbVersion=${DbVersion} --build-arg "BUILDER_UID=${CURRENT_UID}" -t lfmerge-build-${DbVersion} . -done - -. docker/scripts/get-version-number.sh - -# Clean out previous installation files if they exist +dotnet clean LfMerge.sln || true [ -d tarball ] && rm -rf tarball -mkdir -p ${HOME}/.nuget/packages +# Set MsBuildVersion environment variable (and a couple others) to use in build-and-test.sh +. docker/scripts/get-version-number.sh -# Run the build +# Run build once for each DbVersion for DbVersion in ${DBMODEL_VERSIONS[@]}; do - docker run -it \ - --mount type=bind,source="$(pwd)",target=/home/builder/repo \ - --mount type=bind,src="${HOME}/.nuget/packages",dst=/home/builder/.nuget/packages \ - --mount type=tmpfs,dst=/tmp \ - --env "BUILD_NUMBER=999" \ - --env "DebPackageVersion=${DebPackageVersion}" \ - --env "Version=${MsBuildVersion}" \ - --env "MajorMinorPatch=${MajorMinorPatch}" \ - --env "AssemblyVersion=${AssemblySemVer}" \ - --env "FileVersion=${AssemblySemFileVer}" \ - --env "InformationalVersion=${InformationalVersion}" \ - --name tmp-lfmerge-build-${DbVersion} \ - lfmerge-build-${DbVersion} + docker/scripts/build-and-test.sh ${DbVersion} done -time docker build -t ghcr.io/sillsdev/lfmerge -f Dockerfile.finalresult . +time docker build -t ghcr.io/sillsdev/lfmerge:${MsBuildVersion:-latest} -f Dockerfile.finalresult . diff --git a/src/FixFwData/FixFwData.csproj b/src/FixFwData/FixFwData.csproj index dc77f197..0b478392 100644 --- a/src/FixFwData/FixFwData.csproj +++ b/src/FixFwData/FixFwData.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 WinExe FixFwData Debug;Release diff --git a/src/LfMerge.Core.Tests/LfMerge.Core.Tests.csproj b/src/LfMerge.Core.Tests/LfMerge.Core.Tests.csproj index 09451a04..e016ab04 100644 --- a/src/LfMerge.Core.Tests/LfMerge.Core.Tests.csproj +++ b/src/LfMerge.Core.Tests/LfMerge.Core.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 LfMerge.Core.Tests Debug;Release LfMerge.Core.Tests @@ -13,6 +13,7 @@ https://github.com/sillsdev/LfMerge false ../../output/$(Configuration) + $(MSBuildProjectDirectory)\$(OutputPath) ../../output true ../../LfMerge.snk @@ -27,19 +28,33 @@ See full changelog at https://github.com/sillsdev/LfMerge/blob/develop/CHANGELOG false 7000072 DEBUG;TRACE;DBVERSION_$(DatabaseVersion); + $(MSBuildProjectDirectory)\$(OutputPath) - - + + - - + + + + - + + + + + + SIL.LCModel.Core.dll.config + PreserveNewest + + + icu.net.dll.config + PreserveNewest + diff --git a/src/LfMerge.Core/LfMerge.Core.csproj b/src/LfMerge.Core/LfMerge.Core.csproj index a1bed96f..e3272c3e 100644 --- a/src/LfMerge.Core/LfMerge.Core.csproj +++ b/src/LfMerge.Core/LfMerge.Core.csproj @@ -13,6 +13,7 @@ https://github.com/sillsdev/LfMerge false ../../output/$(Configuration) + $(MSBuildProjectDirectory)\$(OutputPath) ../../output true ../../LfMerge.snk @@ -29,6 +30,7 @@ See full changelog at https://github.com/sillsdev/LfMerge/blob/develop/CHANGELOG 7000072 DEBUG;TRACE;DBVERSION_$(DatabaseVersion); false + $(MSBuildProjectDirectory)\$(OutputPath) @@ -39,12 +41,14 @@ See full changelog at https://github.com/sillsdev/LfMerge/blob/develop/CHANGELOG - - - - + + + + + + @@ -55,10 +59,18 @@ See full changelog at https://github.com/sillsdev/LfMerge/blob/develop/CHANGELOG chorusmerge PreserveNewest - + ChorusMerge.runtimeconfig.json PreserveNewest + + SIL.LCModel.Core.dll.config + PreserveNewest + + + icu.net.dll.config + PreserveNewest + GOLDEtic.xml GOLDEtic.xml diff --git a/src/LfMerge.Tests/LfMerge.Tests.csproj b/src/LfMerge.Tests/LfMerge.Tests.csproj index 39c03086..465a5ee8 100644 --- a/src/LfMerge.Tests/LfMerge.Tests.csproj +++ b/src/LfMerge.Tests/LfMerge.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 LfMerge.Tests Debug;Release LfMerge.Tests @@ -32,8 +32,8 @@ See full changelog at https://github.com/sillsdev/LfMerge/blob/develop/CHANGELOG - - + + diff --git a/src/LfMerge/LfMerge.csproj b/src/LfMerge/LfMerge.csproj index 042e00e8..c62602e6 100644 --- a/src/LfMerge/LfMerge.csproj +++ b/src/LfMerge/LfMerge.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Exe LfMerge Debug;Release diff --git a/src/LfMergeAuxTool/LfMergeAuxTool.csproj b/src/LfMergeAuxTool/LfMergeAuxTool.csproj index 10e3b05c..abe23452 100644 --- a/src/LfMergeAuxTool/LfMergeAuxTool.csproj +++ b/src/LfMergeAuxTool/LfMergeAuxTool.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 LfMergeAuxTool Debug;Release LfMergeAuxTool diff --git a/src/LfMergeQueueManager/LfMergeQueueManager.csproj b/src/LfMergeQueueManager/LfMergeQueueManager.csproj index 448676e5..9e63cf41 100644 --- a/src/LfMergeQueueManager/LfMergeQueueManager.csproj +++ b/src/LfMergeQueueManager/LfMergeQueueManager.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 LfMerge.QueueManager Debug;Release LfMergeQueueManager