Skip to content

Commit

Permalink
Nightly Release Workflow Fixes (#3537)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Feb 13, 2025
1 parent fc3a7b0 commit 5060ed3
Show file tree
Hide file tree
Showing 24 changed files with 177 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .github/actions/build-deb-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ runs:
run: |
docker run --rm \
-v "$GITHUB_WORKSPACE:/workspace" \
-e DEBEMAIL="[email protected]" \
-e DEBFULLNAME="CI" \
-e ICE_VERSION=${{ inputs.ice_version }} \
-e DEB_BUILD_OPTIONS="${{ inputs.deb_build_options }}" \
-e DEB_BUILD_PROFILES="${{ inputs.deb_build_profiles }}" \
Expand Down
1 change: 1 addition & 0 deletions .github/actions/build-rpm-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ runs:
docker run --rm \
-v "$GITHUB_WORKSPACE:/workspace" \
-e ICE_VERSION="${{ inputs.ice_version }}" \
-e GIT_TAG="${{ github.ref_name }}" \
-e TARGET_ARCH="${{ inputs.arch }}" \
ice-rpm-package-builder /workspace/ice/packaging/rpm/build-package.sh
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/actions/setup-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ runs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
if: runner.os != 'Windows'

- uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-deb-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
arch: x86_64
deb_build_profiles: "no-python312"

- os: debian12
- distribution: debian-12
arch: aarch64
deb_build_profiles: "no-python312"

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-dotnet-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ jobs:
run: nuget restore cpp/msbuild/ice.sln

- name: Pack .NET Packages
run: dotnet msbuild csharp/msbuild/ice.proj /t:Pack /p:Configuration=Release /p:Platform=x64
run: dotnet msbuild csharp\msbuild\ice.proj /t:Pack /p:Configuration=Release /p:Platform=x64
env:
VERSION: ${{ inputs.ice_version || '' }}
Version: ${{ inputs.ice_version || '' }}
PackageVersion: ${{ inputs.ice_version || '' }}

- name: Upload NuGet Packages
uses: actions/upload-artifact@v4
Expand All @@ -104,5 +105,5 @@ jobs:
- name: Publish NuGet Packages
run: |
dotnet nuget push csharp/msbuild/zeroc.ice.net/*.nupkg --source ${{ inputs.source_url }} --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push csharp\msbuild\zeroc.ice.net\*.nupkg --source ${{ inputs.source_url }} --api-key ${{ secrets.NUGET_API_KEY }}
if: inputs.source_url != ''
6 changes: 3 additions & 3 deletions .github/workflows/build-gem-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
workflow_call:
inputs:
ice_version:
required: true
required: false
type: string
repository_url:
required: true
required: false
type: string
secrets:
REPOSITORY_USERNAME:
Expand Down Expand Up @@ -56,5 +56,5 @@ jobs:
- name: Publish GEM Packages
run: |
curl -u "${REPOSITORY_USERNAME}:${REPOSITORY_PASSWORD}" \
--upload-file "ruby/*.gem" ${{ inputs.repository_url }}
--upload-file ruby/*.gem ${{ inputs.repository_url }}
if: inputs.repository_url != ''
3 changes: 2 additions & 1 deletion .github/workflows/build-maven-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
type: string

jobs:
build-slice-compilers:
build-maven-packages:
runs-on: ubuntu-24.04

steps:
Expand Down Expand Up @@ -56,6 +56,7 @@ jobs:

- name: Publish Maven Packages
run: ./gradlew publish
working-directory: java
env:
MAVEN_REPOSITORY: ${{ inputs.repository_url }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-msi-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: Build MSI
run: dotnet build -c Release -p:Platform=x64
working-directory: packaging/msi
env:
# TODO compute this variable see issue #3558
VCInstallDir: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC"

- name: Upload NuGet Packages
uses: actions/upload-artifact@v4
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build-nightly-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
repository_url:
description: "URL of the repository to publish to"
required: false
default: "https://download.zeroc.com/nexus/"
default: "https://download.zeroc.com/nexus/repository"

jobs:
set-version:
Expand All @@ -32,20 +32,20 @@ jobs:
VERSION=3.8.0
# Set version variables for nightly packages according to the platform conventions:
# - DEB: 3.8.0-0.nightlyYYYYMMDD.BUILD
# - DEB: 3.8.0-0.nightly<YYYYMMDD>.<BUILD>
echo "deb_version=${VERSION}-0.nightly${DATE}.${BUILD}" >> $GITHUB_OUTPUT
# - GEM: 3.8.0.pre.YYYYMMDD.BUILD
# - GEM: 3.8.0.pre.<YYYYMMDD>.<BUILD>
echo "gem_version=${VERSION}.pre.${DATE}.${BUILD}" >> $GITHUB_OUTPUT
# - MAVEN: 3.8.0-nightly-YYYYMMDD.BUILD-SNAPSHOT
# - MAVEN: 3.8.0-nightly-<YYYYMMDD>.<BUILD>-SNAPSHOT
echo "maven_version=${VERSION}-nightly-${DATE}.${BUILD}-SNAPSHOT" >> $GITHUB_OUTPUT
# - NPM: 3.8.0-nightly.YYYYMMDD.BUILD
# - NPM: 3.8.0-nightly.<YYYYMMDD>.<BUILD>
echo "npm_version=${VERSION}-nightly.${DATE}.${BUILD}" >> $GITHUB_OUTPUT
# - NuGet: 3.8.0-nightly.YYYYMMDD.BUILD
# - NuGet: 3.8.0-nightly.<YYYYMMDD>.<BUILD>
echo "nuget_version=${VERSION}-nightly.${DATE}.${BUILD}" >> $GITHUB_OUTPUT
# - PyPI: 3.8.0.devYYYYMMDD.BUILD
echo "pypi_version=${VERSION}.dev${DATE}.${BUILD}" >> $GITHUB_OUTPUT
# - RPM: 3.8.0-0.nightlyYYYYMMDD.BUILD
echo "rpm_version=${VERSION}-0.nightly${DATE}.${BUILD}" >> $GITHUB_OUTPUT
# - PyPI: 3.8.0.dev<YYYYMMDD><BUILD>
echo "pypi_version=${VERSION}.dev${DATE}${BUILD}" >> $GITHUB_OUTPUT
# - RPM: 3.8.0~0.nightly<YYYYMMDD>.<BUILD>
echo "rpm_version=${VERSION}~0.nightly${DATE}.${BUILD}" >> $GITHUB_OUTPUT
build-deb-packages:
name: Build DEB Packages
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ jobs:
working-directory: ice/js

- name: Update Version
run: |
sed -i 's/"version":.*/"version": "${{ inputs.ice_version }}"/' package.json
working-directory: ice/js
run: npm version ${{ inputs.ice_version }}
if: inputs.ice_version != ''

- name: Pack npm
Expand All @@ -119,10 +119,11 @@ jobs:
path: ice/js/*.tgz

- name: Publish NPM Packages
working-directory: ice/js
run: |
echo "//${{ inputs.registry_url }}/:_auth=\${NPM_AUTH_TOKEN}" > ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
npm publish ice/js/*.tgz --registry ${{ inputs.registry_url }}
npm publish *.tgz --registry ${{ inputs.registry_url }}
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: inputs.registry_url != ''
7 changes: 4 additions & 3 deletions .github/workflows/build-pip-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build
python3 -m pip install toml
- name: Update PYPI Version
working-directory: python
run: sed -i 's/version = .*/version = "${{ inputs.ice_version }}"/' pyproject.toml
run: python3 packaging/pypi/update_version.py ${{ inputs.ice_version }} python/pyproject.toml
if: inputs.ice_version != ''

- name: Build PIP Package
Expand All @@ -74,7 +74,8 @@ jobs:
path: artifacts

- name: Publish PIP Package
run: mkdir -p ${{ github.workspace }}/dist
run: |
mkdir -p ${{ github.workspace }}/dist
cp -r artifacts/pip-packages-windows-latest/*.whl ${{ github.workspace }}/dist
cp -r artifacts/pip-packages-macos-latest/*.whl ${{ github.workspace }}/dist
cp -r artifacts/pip-packages-macos-latest/*.tar.gz ${{ github.workspace }}/dist
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-xcframework-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:

- name: Build XCFramework Packages
run: make OPTIMIZE=yes PLATFORMS="all" CONFIGS="static" srcs
working-directory: cpp

- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions cpp/doxygen/examples/Ice/Makefile.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) ZeroC, Inc.

$(project)_libraries = IceExamples
$(project)_caninstall := no

IceExamples_dependencies := Ice
IceExamples_targetdir := doxygen/examples/lib
Expand Down
29 changes: 22 additions & 7 deletions csharp/msbuild/ice.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\..\..\config\icebuilder.props" />
<PropertyGroup>
<PackageVersion Condition="'$(PackageVersion)' == ''">$(IceJSONVersion)</PackageVersion>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\..\..\config\ice.common.targets" />

Expand All @@ -20,7 +23,21 @@
<!-- .NET projects to build with dist target -->
<DistProjects Include="../src/**/*.csproj">
<Properties>Configuration=$(Configuration);Platform=Any CPU;CppPlatform=$(CppPlatform)</Properties>
<Properties Condition="'$(Version)' != ''">Version=$(Version)</Properties>
<Properties Condition="'$(PackageVersion)' != ''">PackageVersion=$(PackageVersion)</Properties>
</DistProjects>

<!-- .NET projects to pack -->
<IceBoxNetProject Include="$(MSBuildThisFileDirectory)..\src\IceBoxNet\IceBoxNet.csproj">
<Properties>Configuration=$(Configuration);Platform=Any CPU;AppTargetFramework=net8.0</Properties>
<Properties Condition="'$(Version)' != ''">Version=$(Version)</Properties>
<Properties Condition="'$(PackageVersion)' != ''">PackageVersion=$(PackageVersion)</Properties>
</IceBoxNetProject>
<PackProject Include="zeroc.ice.net.csproj">
<Properties>Configuration=$(Configuration);Platform=Any CPU;CppPlatform=$(CppPlatform)</Properties>
<Properties Condition="'$(Version)' != ''">Version=$(Version)</Properties>
<Properties Condition="'$(PackageVersion)' != ''">PackageVersion=$(PackageVersion)</Properties>
</PackProject>
</ItemGroup>

<Target Name="NuGetRestore">
Expand Down Expand Up @@ -51,10 +68,8 @@

<Target Name="Pack" DependsOnTargets="BuildDist">
<RemoveDir Directories="zeroc.ice.net" />
<MSBuild Projects="$(MSBuildThisFileDirectory)..\src\IceBoxNet\IceBoxNet.csproj"
Properties="Configuration=$(Configuration);Platform=Any CPU;AppTargetFramework=net8.0"
Targets="Restore;Publish" />
<MSBuild Projects="zeroc.ice.net.csproj" Targets="Restore;Pack"/>
<MSBuild Projects="@(IceBoxNetProject)" Properties="%(Properties)" Targets="Restore;Publish" />
<MSBuild Projects="@(PackProject)" Properties="%(Properties)" Targets="Restore;Pack"/>
<RemoveDir Directories="obj"/>
<Delete Files="zeroc.ice.net\zeroc.ice.net.deps.json;zeroc.ice.net\zeroc.ice.net.dll;zeroc.ice.net\zeroc.ice.net.pdb"/>
</Target>
Expand All @@ -68,8 +83,8 @@
<NuGetGlobalPackages>$(NuGetGlobalPackages.TrimStart('global-packages: '))</NuGetGlobalPackages>
</PropertyGroup>

<RemoveDir Directories="$(NuGetGlobalPackages)\zeroc.ice.net\$(IceJSONVersion)"
Condition="Exists('$(NuGetGlobalPackages)\zeroc.ice.net\$(IceJSONVersion)')"/>
<Exec Command="dotnet nuget push $(MSBuildThisFileDirectory)zeroc.ice.net\zeroc.ice.net.$(IceJSONVersion).nupkg --source $(NuGetGlobalPackages)" />
<RemoveDir Directories="$(NuGetGlobalPackages)\zeroc.ice.net\$(PackageVersion)"
Condition="Exists('$(NuGetGlobalPackages)\zeroc.ice.net\$(PackageVersion)')"/>
<Exec Command="dotnet nuget push $(MSBuildThisFileDirectory)zeroc.ice.net\zeroc.ice.net.$(PackageVersion).nupkg --source $(NuGetGlobalPackages)" />
</Target>
</Project>
11 changes: 7 additions & 4 deletions packaging/dpkg/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ else
ICE_VERSION=$(dpkg-parsechangelog --file /workspace/build/debian/changelog --show-field Version)
fi

# Generate a tarball of the current repository state for the given ICE_VERSION
echo "Creating tarball for ICE_VERSION=$ICE_VERSION"
UPSTREAM_VERSION=$(echo $ICE_VERSION | cut -f1 -d'-')

# Generate a tarball of the current repository state for the given UPSTREAM_VERSION
echo "Creating tarball for UPSTREAM_VERSION=$UPSTREAM_VERSION"
cd /workspace/ice
git archive --format=tar.gz -o /workspace/zeroc-ice_${ICE_VERSION}.orig.tar.gz HEAD
git config --global --add safe.directory /workspace/ice
git archive --format=tar.gz -o /workspace/zeroc-ice_${UPSTREAM_VERSION}.orig.tar.gz HEAD

# Unpack the source tarball
cd /workspace/build
tar xzf ../zeroc-ice_${ICE_VERSION}.orig.tar.gz
tar xzf ../zeroc-ice_${UPSTREAM_VERSION}.orig.tar.gz

# Build the source package (-S generates .dsc and .tar.gz files)
dpkg-buildpackage -S
Expand Down
1 change: 1 addition & 0 deletions packaging/msi/Ice.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<ItemGroup>
<BindPath Include="$(MBuildThisFileDirectory)..\..\" BindName="SOURCE_ROOT" />
<BindPath Include="$(VCInstallDir)\Redist\MSVC\v143\MergeModules\" BindName="MERGE_MODULES" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions packaging/msi/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

<!-- VC140 C++ runtime merge module -->
<StandardDirectory Id="TARGETDIR">
<Merge Id="VC140CRT"
SourceFile="$(env.CommonProgramFiles(x86))\Merge Modules\Microsoft_VC140_CRT_x64.msm"
<Merge Id="VC143CRT"
SourceFile="!(bindpath.MERGE_MODULES)\Microsoft_VC143_CRT_x64.msm"
Language="0"/>
</StandardDirectory>

Expand Down Expand Up @@ -113,7 +113,7 @@
<Feature Id="MainFeature" Title="Ice" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="StartMenuComponents"/>
<MergeRef Id="VC140CRT"/>
<MergeRef Id="VC143CRT"/>
</Feature>
</Package>
</Wix>
17 changes: 17 additions & 0 deletions packaging/pypi/update_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import toml
import sys

if len(sys.argv) != 3:
print("Usage: update_version.py <new_version> <project.toml>")
sys.exit(1)

new_version = sys.argv[1]
path = sys.argv[2]

data = toml.load(path)
data["project"]["version"] = new_version

with open(path, "w") as f:
toml.dump(data, f)

print(f"Updated version to {new_version}")
10 changes: 7 additions & 3 deletions packaging/rpm/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ fi

# Define common RPM macros
RPM_MACROS=()
RPM_MACROS+=(-D "_topdir $RPM_BUILD_ROOT")
RPM_MACROS+=(-D "vendor ZeroC, Inc.")
RPM_MACROS+=(--define "_topdir $RPM_BUILD_ROOT")
RPM_MACROS+=(--define "vendor ZeroC, Inc.")

if [[ -n "${GIT_TAG:-}" ]]; then
RPM_MACROS+=(--define "git_tag $GIT_TAG")
fi

# Download sources
cd "$RPM_BUILD_ROOT/SOURCES"
spectool -g "$ICE_SPEC_DEST" || { echo "Error: Failed to download sources."; exit 1; }
spectool -g "${RPM_MACROS[@]}" "$ICE_SPEC_DEST" || { echo "Error: Failed to download sources."; exit 1; }

# Build source RPM
rpmbuild -bs "$ICE_SPEC_DEST" "${RPM_MACROS[@]}" --target="$TARGET_ARCH"
Expand Down
2 changes: 1 addition & 1 deletion packaging/rpm/docker/rhel9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN dnf install -y https://zeroc.com/download/ice/3.7/el9/ice-repo-3.7.el9.noarc
RUN dnf install --setopt=multilib_policy=all -y \
rpmdevtools \
make \
curl \
curl-minimal \
git \
gcc-c++ \
glibc-devel \
Expand Down
18 changes: 18 additions & 0 deletions packaging/rpm/glacier2router.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) ZeroC, Inc.

[Unit]
Description=Glacier2 router daemon
Documentation=man:glacier2router(1)
Documentation=https://doc.zeroc.com/ice/latest/ice-services/glacier2
After=syslog.target network.target

[Service]
ExecStart=/usr/bin/glacier2router --Ice.Config=/etc/glacier2router.conf
Type=notify
NotifyAccess=main
RuntimeDirectory=glacier2router
KillMode=process
User=ice

[Install]
WantedBy=multi-user.target
Loading

0 comments on commit 5060ed3

Please sign in to comment.