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

Support building on macOS #4320

Merged
merged 17 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,8 @@ dotnet_diagnostic.IDE0090.severity = none
# Allow namespaces to be independent of folder names
dotnet_diagnostic.IDE0130.severity = none

# Allow file-scoped namespaces
dotnet_diagnostic.IDE0160.severity = none

# Who cares if it's a JSON formatted string, in a test?
dotnet_diagnostic.JSON002.severity = none
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# Build files
*.cake text
*.ps1 text
build text eol=lf
*.sh text eol=lf
Dockerfile text eol=lf

# Other
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
uses: actions/cache@v4
with:
path: _build/tools
key: build-tools-${{ hashFiles('build', 'build.ps1', 'build.cake') }}
key: build-tools-${{ hashFiles('build.sh', 'build.ps1', 'build/*') }}
- name: Restore cache for _build/cake
uses: actions/cache@v4
with:
path: _build/cake
key: build-cake-${{ hashFiles('build.cake') }}
key: build-cake-${{ hashFiles('build/*') }}
- name: Restore cache for _build/lib/nuget
uses: actions/cache@v4
with:
Expand All @@ -36,7 +36,7 @@ jobs:
~/.nuget/packages
key: nuget-oldref-modules-${{ hashFiles('**/packages.config') }}-${{ hashFiles('**/*.csproj') }}
- name: Build ckan.exe and netkan.exe
run: ./build --configuration=${{ inputs.configuration }}
run: ./build.sh --configuration=${{ inputs.configuration }}
- name: Upload repack artifact
id: upload-repack-artifact
uses: actions/upload-artifact@v4
Expand All @@ -52,7 +52,7 @@ jobs:
retention-days: 1
- name: Bundle assets for signing
if: inputs.configuration == 'Release'
run: ./build Prepare-SignPath --configuration=${{ inputs.configuration }} --exclusive
run: ./build.sh Prepare-SignPath --configuration=${{ inputs.configuration }} --exclusive
- name: Upload unsigned artifact
id: upload-unsigned-artifact
if: inputs.configuration == 'Release'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
name: Release-repack-unsigned
path: _build/repack/
- name: Build dmg
run: ./build osx --configuration=Release --exclusive
run: ./build.sh osx --configuration=Release --exclusive
- name: Push dmg to S3
run: aws s3 cp _build/osx/CKAN.dmg s3://${AWS_S3_BUCKET} --follow-symlinks

Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Build deb
env:
CODENAME: nightly
run: ./build deb --configuration=Release --exclusive
run: ./build.sh deb --configuration=Release --exclusive
- name: Import GPG key
env:
DEBIAN_PRIVATE_KEY: ${{ secrets.DEBIAN_PRIVATE_KEY }}
Expand All @@ -149,7 +149,7 @@ jobs:
env:
CODENAME: nightly
DEBIAN_PRIVATE_KEY: ${{ secrets.DEBIAN_PRIVATE_KEY }}
run: ./build deb-sign --configuration=Release --exclusive
run: ./build.sh deb-sign --configuration=Release --exclusive
if: ${{ env.DEBIAN_PRIVATE_KEY }}
- name: Push deb to S3
run: aws s3 sync _build/deb/apt-repo-root s3://${AWS_S3_BUCKET}/deb --follow-symlinks
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
mkdir -p _build/repack/Release
cp _build/signed/ckan.exe _build/repack/Release
- name: Build rpm
run: ./build rpm --configuration=Release --exclusive
run: ./build.sh rpm --configuration=Release --exclusive
- name: Import GPG key
env:
DEBIAN_PRIVATE_KEY: ${{ secrets.DEBIAN_PRIVATE_KEY }}
Expand All @@ -206,7 +206,7 @@ jobs:
env:
CODENAME: nightly
DEBIAN_PRIVATE_KEY: ${{ secrets.DEBIAN_PRIVATE_KEY }}
run: ./build rpm-repo --configuration=Release --exclusive
run: ./build.sh rpm-repo --configuration=Release --exclusive
if: ${{ env.DEBIAN_PRIVATE_KEY }}
- name: Push nightly PRM repo to S3
run: aws s3 sync _build/rpm/repo s3://${AWS_S3_BUCKET}/rpm/nightly --follow-symlinks
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
name: Release-repack-unsigned
path: _build/repack/
- name: Build dmg
run: ./build osx --configuration=Release --exclusive
run: ./build.sh osx --configuration=Release --exclusive
- name: Upload OSX release asset
run: gh release upload ${{ github.event.release.tag_name }} _build/osx/CKAN.dmg
env:
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Build deb
env:
CODENAME: stable
run: ./build deb --configuration=Release --exclusive
run: ./build.sh deb --configuration=Release --exclusive
- name: Import GPG key
env:
DEBIAN_PRIVATE_KEY: ${{ secrets.DEBIAN_PRIVATE_KEY }}
Expand All @@ -91,7 +91,7 @@ jobs:
env:
CODENAME: stable
DEBIAN_PRIVATE_KEY: ${{ secrets.DEBIAN_PRIVATE_KEY }}
run: ./build deb-sign --configuration=Release --exclusive
run: ./build.sh deb-sign --configuration=Release --exclusive
if: ${{ env.DEBIAN_PRIVATE_KEY }}
- name: Push deb to S3
run: aws s3 sync _build/deb/apt-repo-root s3://${AWS_S3_BUCKET}/deb --follow-symlinks
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
VERSION=$(echo "${{ github.event.release.tag_name }}" | tr -d v)
echo "RPM_VERSION=${VERSION}.$(date +'%g%j')" >> $GITHUB_ENV
- name: Build rpm
run: ./build rpm --configuration=Release --exclusive
run: ./build.sh rpm --configuration=Release --exclusive
- name: Import GPG key
env:
DEBIAN_PRIVATE_KEY: ${{ secrets.DEBIAN_PRIVATE_KEY }}
Expand All @@ -141,7 +141,7 @@ jobs:
env:
CODENAME: stable
DEBIAN_PRIVATE_KEY: ${{ secrets.DEBIAN_PRIVATE_KEY }}
run: ./build rpm-repo --configuration=Release --exclusive
run: ./build.sh rpm-repo --configuration=Release --exclusive
if: ${{ env.DEBIAN_PRIVATE_KEY }}
- name: Push stable RPM repo to S3
run: aws s3 sync _build/rpm/repo s3://${AWS_S3_BUCKET}/rpm/stable --follow-symlinks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
name: Debug-repack-unsigned
path: _build/repack/
- name: Run tests
run: xvfb-run ./build test+only --configuration=Debug --where="Category!=FlakyNetwork"
run: xvfb-run ./build.sh test+only --configuration=Debug --where="Category!=FlakyNetwork"

# notify:
# needs:
Expand Down
68 changes: 67 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/_build/
/.vs/
/tools
/build/tools
test-results
*.userprefs
*.csproj.user
Expand Down Expand Up @@ -52,3 +52,69 @@ bld/
/.venv/

quotes.txt.dat

### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Rider template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# mpeltonen/sbt-idea plugin
.idea_modules/

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
8 changes: 8 additions & 0 deletions .idea/.idea.CKAN/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/.idea.CKAN/.idea/projectSettingsUpdater.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/.idea.CKAN/.idea/runConfigurations/Run_Build__Debug_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.CKAN/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AutoUpdate/CKAN-autoupdate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -Command &quot;.\build.ps1 Generate-GlobalAssemblyVersionInfo&quot;"
WorkingDirectory=".."
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo"
<Exec Command="sh ../build.sh Generate-GlobalAssemblyVersionInfo"
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
</Target>
</Project>
2 changes: 2 additions & 0 deletions CKAN.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKAN-netkan", "Netkan\CKAN-
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{4F41255E-8BC1-465B-82D5-1C5665BC099A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build", "build\Build.csproj", "{B3D22D01-132E-4D78-BA9E-FAC2AD02F2E1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion Cmdline/CKAN-cmdline.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -Command &quot;.\build.ps1 Generate-GlobalAssemblyVersionInfo&quot;"
WorkingDirectory=".."
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo"
<Exec Command="sh ../build.sh Generate-GlobalAssemblyVersionInfo"
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion ConsoleUI/CKAN-ConsoleUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -Command &quot;.\build.ps1 Generate-GlobalAssemblyVersionInfo&quot;"
WorkingDirectory=".."
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo"
<Exec Command="sh ../build.sh Generate-GlobalAssemblyVersionInfo"
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Core/CKAN-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -Command &quot;.\build.ps1 Generate-GlobalAssemblyVersionInfo&quot;"
WorkingDirectory=".."
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo"
<Exec Command="sh ../build.sh Generate-GlobalAssemblyVersionInfo"
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ COPY . /source
WORKDIR /source
ARG config
ENV config ${config:-Release}
RUN ./build --configuration=${config}
RUN ./build.sh --configuration=${config}
RUN mkdir /build
RUN cp _build/repack/${config}/ckan.exe /build/ckan.exe
ENTRYPOINT ["/root/entrypoint.sh"]
2 changes: 1 addition & 1 deletion GUI/CKAN-GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -Command &quot;.\build.ps1 Generate-GlobalAssemblyVersionInfo&quot;"
WorkingDirectory=".."
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo"
<Exec Command="sh ../build.sh Generate-GlobalAssemblyVersionInfo"
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Netkan/CKAN-netkan.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -Command &quot;.\build.ps1 Generate-GlobalAssemblyVersionInfo&quot;"
WorkingDirectory=".."
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo"
<Exec Command="sh ../build.sh Generate-GlobalAssemblyVersionInfo"
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -Command &quot;.\build.ps1 Generate-GlobalAssemblyVersionInfo&quot;"
WorkingDirectory=".."
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo"
<Exec Command="sh ../build.sh Generate-GlobalAssemblyVersionInfo"
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
</Target>
</Project>
Loading