Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mercurial version #333

Merged
merged 44 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1582036
update mercurial version to 3.0.3.11
hahn-kev Mar 4, 2024
504c8e4
update lib chorus version to use mercurial 6
hahn-kev Mar 4, 2024
f2a0573
update base images to use python3 and dotnet 8
hahn-kev Mar 4, 2024
a1bf64a
set base image back to dotnet 6
hahn-kev Mar 4, 2024
4b05737
Fix installer for Mercurial 6
rmunn Mar 4, 2024
9438d15
Also update LfMergeBridge version
rmunn Mar 4, 2024
c8b8aea
Switch build to use .NET 8.0 instead of 6.0
rmunn Mar 4, 2024
030fc97
Fix output path for NuGet package
rmunn Mar 4, 2024
317ff12
Go back to Mercurial 3.0.3.11
rmunn Mar 5, 2024
92e5cd1
Final Dockerfile doesn't need python, it's in base
rmunn Mar 5, 2024
1f80c15
Switch build to use .NET 8.0 instead of 6.0
rmunn Mar 5, 2024
480d7f9
.NET 8 images only provide Python 3
rmunn Mar 5, 2024
2abcd66
Revert "Go back to Mercurial 3.0.3.11"
rmunn Mar 5, 2024
431d81b
Use fixed Mercurial package
rmunn Mar 5, 2024
26274c2
Fix libdl.so error in GHA build
rmunn Mar 14, 2024
d35f864
Don't fail if httpclient not found
rmunn Mar 14, 2024
67aa5ff
Tests should use same LCModel version as core code
rmunn Mar 14, 2024
9183353
More NuGet version updates
rmunn Mar 14, 2024
ac66b0d
LCModel.Core copy step needs TargetDir
rmunn Mar 14, 2024
737b0fc
Try to debug linking in the build
rmunn Mar 14, 2024
3f80dc2
Better location for LD_DEBUG env var
rmunn Mar 14, 2024
3a26838
Less spammy LD_DEBUG
rmunn Mar 14, 2024
f3ed495
Try LD_DEBUG=files
rmunn Mar 14, 2024
598c5aa
Also copy dll config for icu.net
rmunn Mar 14, 2024
d3f4d05
Remove LD_DEBUG env var
rmunn Mar 14, 2024
ac548ca
Added missing GeneratePathProperty
rmunn Mar 14, 2024
528878f
New GHA workflow for simpler dotnet build
rmunn Mar 25, 2024
445da79
pbuild.sh shouldn't fail if dotnet clean does
rmunn Mar 26, 2024
01760ec
Update ChorusMerge to version with net8.0 build
rmunn Mar 26, 2024
68e1564
Select correct ChorusMerge runtime config
rmunn Mar 26, 2024
45aa86b
LfMerge Dockerfile should be based on .NET 8 now
rmunn Mar 26, 2024
4e5450c
Add missing Mercurial package to Docker image
rmunn Mar 27, 2024
78f92d4
Add another Mercurial portion that's required
rmunn Mar 27, 2024
98238a7
Another required Mercurial component
rmunn Mar 27, 2024
a077b24
More missing Mercurial components
rmunn Mar 27, 2024
e493084
Rest of missing Mercurial components
rmunn Mar 27, 2024
7933f62
Have pbuild.sh script tag builds with branch name
rmunn Mar 27, 2024
58ef773
We know the GHA workflow works, remove test branch
rmunn Mar 27, 2024
ef85f96
Try uploading files directly, not in tarball
rmunn Mar 27, 2024
dd24720
If not uploading tarballs, need merge-multiple
rmunn Mar 27, 2024
c499396
Fix download folder name
rmunn Mar 27, 2024
b0138b0
No longer need buildx in build step
rmunn Mar 27, 2024
7b9b70f
Restore tarball step as it really is needed
rmunn Mar 27, 2024
7d4fabd
Clean up TODO comment
rmunn Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docker-build
name: dotnet-build

on:
push:
Expand All @@ -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

Expand All @@ -42,57 +42,68 @@ jobs:
TAG: v${{ steps.version.outputs.MsBuildVersion }}
VERSION: ${{ steps.version.outputs.MsBuildVersion }}

- name: Set up buildx for Docker
uses: docker/[email protected]

- 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/[email protected]
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/[email protected]
if: always()
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 }}
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions Dockerfile.builder-base
Original file line number Diff line number Diff line change
@@ -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
rmunn marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
10 changes: 8 additions & 2 deletions Dockerfile.finalresult
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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* /
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.runtime-base
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion LfMerge.TestApp/LfMerge.TestApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>LfMerge.TestApp</RootNamespace>
<Configurations>Debug;Release</Configurations>
Expand Down
4 changes: 2 additions & 2 deletions docker/scripts/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
28 changes: 25 additions & 3 deletions docker/scripts/create-installation-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions docker/scripts/get-version-number.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion environ
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 6 additions & 38 deletions pbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
2 changes: 1 addition & 1 deletion src/FixFwData/FixFwData.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<OutputType>WinExe</OutputType>
<RootNamespace>FixFwData</RootNamespace>
<Configurations>Debug;Release</Configurations>
Expand Down
Loading
Loading