Skip to content

Commit 518f365

Browse files
committed
- Fixed devcontainer.json to load windows system with necessary dependencies
- Updated github workflows with specific ubuntu, macOS and windows versions
1 parent 647b624 commit 518f365

File tree

9 files changed

+125
-35
lines changed

9 files changed

+125
-35
lines changed

.devcontainer/devcontainer.json

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,43 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
31
{
4-
"name": "C# (.NET)",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/dotnet:0-6.0",
7-
"features": {
8-
"ghcr.io/devcontainers/features/dotnet:1": {
9-
"installUsingApt": true,
10-
"version": "6.0"
11-
},
12-
"ghcr.io/devcontainers/features/ruby:1": {
13-
"version": "3.1"
2+
"name": "C# (.NET) - Ubuntu with Mono",
3+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-jammy",
4+
"onCreateCommand": "git submodule update --init --recursive",
5+
"postAttachCommand": "bash .devcontainer/install-dependencies.sh",
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"ms-dotnettools.csdevkit"
10+
],
11+
"settings": {
12+
"dotnet.server.useOmnisharp": false,
13+
"files.watcherExclude": {
14+
"**/bin/**": true,
15+
"**/obj/**": true,
16+
"**/.git/**": true,
17+
"**/node_modules/**": true,
18+
"**/.vs/**": true
19+
},
20+
"search.exclude": {
21+
"**/bin": true,
22+
"**/obj": true,
23+
"**/node_modules": true
24+
},
25+
"files.eol": "\n"
26+
}
1427
}
1528
},
16-
// Features to add to the dev container. More info: https://containers.dev/features.
17-
// "features": {},
18-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19-
// "forwardPorts": [5000, 5001],
20-
// "portsAttributes": {
21-
// "5001": {
22-
// "protocol": "https"
23-
// }
24-
// }
25-
// Use 'postCreateCommand' to run commands after the container is created.
26-
// Used for downloading all submodules and restoring dotnet tools as a part of dotnet CLI
27-
"postCreateCommand": "git submodule init && git submodule update && dotnet tool restore"
28-
// Configure tool-specific properties.
29-
// "customizations": {},
30-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
31-
// "remoteUser": "root"
29+
"containerEnv": {
30+
"DOTNET_CLI_TELEMETRY_OPTOUT": "1",
31+
"DOTNET_SKIP_FIRST_TIME_EXPERIENCE": "1",
32+
"DOTNET_NOLOGO": "1",
33+
"NUGET_XMLDOC_MODE": "skip",
34+
"DOTNET_CLI_UI_LANGUAGE": "en",
35+
"NUGET_PACKAGES": "${containerWorkspaceFolder}/.nuget/packages"
36+
},
37+
"remoteEnv": {
38+
"PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/.dotnet/tools"
39+
},
40+
"mounts": [
41+
"source=ably-dotnet-nuget-cache,target=${containerWorkspaceFolder}/.nuget/packages,type=volume"
42+
]
3243
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "=========================================="
5+
echo "Installing dependencies for Ably .NET development..."
6+
echo "=========================================="
7+
echo ""
8+
9+
# Update package lists
10+
echo "📦 Updating package lists..."
11+
sudo apt-get update -qq
12+
echo "✓ Package lists updated"
13+
echo ""
14+
15+
# Install prerequisites
16+
echo "📦 Installing prerequisites (gnupg, ca-certificates, wget)..."
17+
sudo apt-get install -y gnupg ca-certificates wget
18+
echo "✓ Prerequisites installed"
19+
echo ""
20+
21+
# Note: Installing Mono from Ubuntu's official repositories
22+
echo "ℹ️ Using Mono from Ubuntu official repositories (jammy)"
23+
echo ""
24+
25+
# Add Microsoft package repository for .NET runtimes
26+
echo "🔑 Adding Microsoft package repository..."
27+
wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
28+
sudo dpkg -i packages-microsoft-prod.deb
29+
rm packages-microsoft-prod.deb
30+
echo "✓ Microsoft repository added"
31+
echo ""
32+
33+
# Update package lists with Microsoft repository
34+
echo "📦 Updating package lists..."
35+
sudo apt-get update -qq
36+
echo "✓ Package lists updated"
37+
echo ""
38+
39+
# Install Mono and NuGet
40+
echo "🔧 Installing Mono and NuGet (this may take a few minutes)..."
41+
sudo apt-get install -y mono-complete nuget
42+
echo "✓ Mono and NuGet installed"
43+
echo ""
44+
45+
# Install .NET 6.0 runtime
46+
echo "🔧 Installing .NET 6.0 runtime..."
47+
sudo apt-get install -y dotnet-runtime-6.0
48+
echo "✓ .NET 6.0 runtime installed"
49+
echo ""
50+
51+
# Install .NET 7.0 runtime
52+
echo "🔧 Installing .NET 7.0 runtime..."
53+
sudo apt-get install -y dotnet-runtime-7.0
54+
echo "✓ .NET 7.0 runtime installed"
55+
echo ""
56+
57+
echo "=========================================="
58+
echo "✅ All dependencies installed successfully!"
59+
echo "=========================================="
60+
echo ""
61+
62+
echo "📋 Installed versions:"
63+
echo ""
64+
echo "Mono version:"
65+
mono --version | head -n 1
66+
echo ""
67+
echo ".NET Runtimes:"
68+
dotnet --list-runtimes
69+
echo ""
70+
echo ".NET SDKs:"
71+
dotnet --list-sdks
72+
echo ""
73+
echo "NuGet version:"
74+
nuget help | head -n 1
75+
echo ""
76+
echo "=========================================="
77+
echo "🎉 Setup complete! You can now build the project."
78+
echo "=========================================="

.github/workflows/package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
${{ github.workspace }}/*.nupkg
148148
149149
package-unity:
150-
runs-on: ubuntu-latest
150+
runs-on: ubuntu-22.04
151151
steps:
152152
- uses: actions/checkout@v4
153153
with:
@@ -174,7 +174,7 @@ jobs:
174174
${{ github.workspace }}/*.unitypackage
175175
176176
merge-artifacts:
177-
runs-on: ubuntu-latest
177+
runs-on: ubuntu-22.04
178178
needs: [package-library, package-push, package-unity]
179179
steps:
180180
- name: Download all artifacts

.github/workflows/run-tests-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
check:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-22.04
1111
env:
1212
DOTNET_NOLOGO: true
1313

.github/workflows/run-tests-macos-mono.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
check:
10-
runs-on: macos-latest
10+
runs-on: macos-13
1111
env:
1212
DOTNET_NOLOGO: true
1313

.github/workflows/run-tests-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
check:
10-
runs-on: macos-latest
10+
runs-on: macos-13
1111
env:
1212
DOTNET_NOLOGO: true
1313

.github/workflows/run-tests-windows-netframework.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
check:
10-
runs-on: windows-latest
10+
runs-on: windows-2022
1111
env:
1212
DOTNET_NOLOGO: true
1313

.github/workflows/run-tests-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
check:
10-
runs-on: windows-latest
10+
runs-on: windows-2022
1111
env:
1212
DOTNET_NOLOGO: true
1313

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ publish/
110110
*.nupkg
111111
# The packages folder can be ignored because of Package Restore
112112
packages/
113+
.nuget/
113114
# except build/, which is used as an MSBuild target.
114115
!packages/build/
115116
# Uncomment if necessary however generally it will be regenerated when needed

0 commit comments

Comments
 (0)