diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index e76d1b87..91abad26 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -6,63 +6,46 @@ name: build on: workflow_call: inputs: - version_override: + libation-version: type: string - description: "Version number override" - required: false - run_unit_tests: + required: true + dotnet-version: + type: string + required: true + run-unit-tests: type: boolean - description: "Skip running unit tests" - required: false - default: true - runs_on: + publish-r2r: + type: boolean + retention-days: + type: number + architecture: type: string - description: "The GitHub hosted runner to use" + description: "CPU architecture targeted by the build." required: true OS: type: string description: > The operating system targeted by the build. - + There must be a corresponding Bundle_$OS.sh script file in ./Scripts required: true - architecture: - type: string - description: "CPU architecture targeted by the build." - required: true - -env: - DOTNET_CONFIGURATION: "Release" - DOTNET_VERSION: "9.0.x" - RELEASE_NAME: "chardonnay" jobs: build: name: "${{ inputs.OS }}-${{ inputs.architecture }}" - runs-on: ${{ inputs.runs_on }} + runs-on: ubuntu-latest + env: + RUNTIME_ID: "linux-${{ inputs.architecture }}" steps: - uses: actions/checkout@v5 - - name: Setup .NET - uses: actions/setup-dotnet@v5 + + - uses: actions/setup-dotnet@v5 with: - dotnet-version: ${{ env.DOTNET_VERSION }} - env: - NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get version - id: get_version - run: | - inputVersion="${{ inputs.version_override }}" - if [[ "${#inputVersion}" -gt 0 ]] - then - version="${inputVersion}" - else - version="$(grep -Eio -m 1 '.*' ./Source/AppScaffolding/AppScaffolding.csproj | sed -r 's/<\/?Version>//g')" - fi - echo "version=${version}" >> "${GITHUB_OUTPUT}" + dotnet-version: ${{ inputs.dotnet-version }} + dotnet-quality: "ga" - name: Unit test - if: ${{ inputs.run_unit_tests }} + if: ${{ inputs.run-unit-tests }} working-directory: ./Source run: dotnet test @@ -70,63 +53,31 @@ jobs: id: publish working-directory: ./Source run: | - if [[ "${{ inputs.OS }}" == "MacOS" ]] - then - display_os="macOS" - RUNTIME_ID="osx-${{ inputs.architecture }}" - else - display_os="Linux" - RUNTIME_ID="linux-${{ inputs.architecture }}" - fi - - OUTPUT="bin/Publish/${display_os}-${{ inputs.architecture }}-${{ env.RELEASE_NAME }}" - - echo "display_os=${display_os}" >> $GITHUB_OUTPUT - echo "Runtime Identifier: $RUNTIME_ID" - echo "Output Directory: $OUTPUT" - - dotnet publish \ - LibationAvalonia/LibationAvalonia.csproj \ - --runtime $RUNTIME_ID \ - --configuration ${{ env.DOTNET_CONFIGURATION }} \ - --output $OUTPUT \ - -p:PublishProfile=LibationAvalonia/Properties/PublishProfiles/${display_os}Profile.pubxml - dotnet publish \ - LoadByOS/${display_os}ConfigApp/${display_os}ConfigApp.csproj \ - --runtime $RUNTIME_ID \ - --configuration ${{ env.DOTNET_CONFIGURATION }} \ - --output $OUTPUT \ - -p:PublishProfile=LoadByOS/Properties/${display_os}ConfigApp/PublishProfiles/${display_os}Profile.pubxml - dotnet publish \ - LibationCli/LibationCli.csproj \ - --runtime $RUNTIME_ID \ - --configuration ${{ env.DOTNET_CONFIGURATION }} \ - --output $OUTPUT \ - -p:PublishProfile=LibationCli/Properties/PublishProfiles/${display_os}Profile.pubxml - dotnet publish \ - HangoverAvalonia/HangoverAvalonia.csproj \ - --runtime $RUNTIME_ID \ - --configuration ${{ env.DOTNET_CONFIGURATION }} \ - --output $OUTPUT \ - -p:PublishProfile=HangoverAvalonia/Properties/PublishProfiles/${display_os}Profile.pubxml + PUBLISH_ARGS=( + '--runtime' '${{ env.RUNTIME_ID }}' + '--configuration' 'Release' + '--output' '../bin' + '-p:PublishProtocol=FileSystem' + "-p:PublishReadyToRun=${{ inputs.publish-r2r }}" + '-p:SelfContained=true') + + dotnet publish LibationAvalonia/LibationAvalonia.csproj "${PUBLISH_ARGS[@]}" + dotnet publish LoadByOS/LinuxConfigApp/LinuxConfigApp.csproj "${PUBLISH_ARGS[@]}" + dotnet publish LibationCli/LibationCli.csproj "${PUBLISH_ARGS[@]}" + dotnet publish HangoverAvalonia/HangoverAvalonia.csproj "${PUBLISH_ARGS[@]}" - name: Build bundle id: bundle - working-directory: ./Source/bin/Publish/${{ steps.publish.outputs.display_os }}-${{ inputs.architecture }}-${{ env.RELEASE_NAME }} run: | - BUNDLE_DIR=$(pwd) - echo "Bundle dir: ${BUNDLE_DIR}" - cd .. - SCRIPT=../../../Scripts/Bundle_${{ inputs.OS }}.sh + SCRIPT=./Scripts/Bundle_${{ inputs.OS }}.sh chmod +rx ${SCRIPT} - ${SCRIPT} "${BUNDLE_DIR}" "${{ steps.get_version.outputs.version }}" "${{ inputs.architecture }}" + ${SCRIPT} ./bin "${{ inputs.libation-version }}" "${{ inputs.architecture }}" artifact=$(ls ./bundle) echo "artifact=${artifact}" >> "${GITHUB_OUTPUT}" - - name: Publish bundle - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v5 with: name: ${{ steps.bundle.outputs.artifact }} - path: ./Source/bin/Publish/bundle/${{ steps.bundle.outputs.artifact }} + path: ./bundle/${{ steps.bundle.outputs.artifact }} if-no-files-found: error - retention-days: 7 + retention-days: ${{ inputs.retention-days }} diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml new file mode 100644 index 00000000..75ba2863 --- /dev/null +++ b/.github/workflows/build-mac.yml @@ -0,0 +1,99 @@ +# build-mac.yml +# Reusable workflow that builds the MacOS (x64 and arm64) versions of Libation. +--- +name: build + +on: + workflow_call: + inputs: + libation-version: + type: string + required: true + dotnet-version: + type: string + required: true + run-unit-tests: + type: boolean + publish-r2r: + type: boolean + retention-days: + type: number + architecture: + type: string + description: "CPU architecture targeted by the build." + required: true + +env: + WAIT_FOR_NOTARIZE: true + +jobs: + build: + name: "macOS-${{ inputs.architecture }}" + runs-on: macos-latest + env: + RUNTIME_ID: "osx-${{ inputs.architecture }}" + CAN_SIGN: ${{ secrets.APPLE_TEAM_ID != '' && vars.APPLE_DEV_EMAIL != '' && secrets.APPLE_DEV_PASSWORD != '' }} + steps: + - uses: apple-actions/import-codesign-certs@v3 + if: ${{ env.CAN_SIGN == 'true' }} + with: + p12-file-base64: ${{ secrets.DISTRIBUTION_SIGNING_CERT }} + p12-password: ${{ secrets.DISTRIBUTION_SIGNING_CERT_PW }} + + - uses: actions/checkout@v5 + + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version }} + dotnet-quality: "ga" + + - name: Unit test + if: ${{ inputs.run-unit-tests }} + working-directory: ./Source + run: dotnet test + + - name: Publish + id: publish + working-directory: ./Source + run: | + PUBLISH_ARGS=( + '--runtime' '${{ env.RUNTIME_ID }}' + '--configuration' 'Release' + '--output' '../bin' + '-p:PublishProtocol=FileSystem' + "-p:PublishReadyToRun=${{ inputs.publish-r2r }}" + '-p:SelfContained=true') + + dotnet publish LibationAvalonia/LibationAvalonia.csproj "${PUBLISH_ARGS[@]}" + dotnet publish LoadByOS/MacOSConfigApp/MacOSConfigApp.csproj "${PUBLISH_ARGS[@]}" + dotnet publish LibationCli/LibationCli.csproj "${PUBLISH_ARGS[@]}" + dotnet publish HangoverAvalonia/HangoverAvalonia.csproj "${PUBLISH_ARGS[@]}" + + - name: Build bundle + id: bundle + run: | + SCRIPT=./Scripts/Bundle_MacOS.sh + chmod +rx ${SCRIPT} + ${SCRIPT} ./bin "${{ inputs.libation-version }}" "${{ inputs.architecture }}" ${{ env.CAN_SIGN }} + artifact=$(ls ./bundle) + echo "artifact=${artifact}" >> "${GITHUB_OUTPUT}" + + - name: Notarize bundle + if: ${{ env.CAN_SIGN == 'true' }} + run: | + if [ ${{ env.WAIT_FOR_NOTARIZE }} ]; then + WAIT="--wait" + fi + + xcrun notarytool submit ./bundle/${{ steps.bundle.outputs.artifact }} $WAIT --no-progress --apple-id ${{ vars.APPLE_DEV_EMAIL }} --password ${{ secrets.APPLE_DEV_PASSWORD }} --team-id ${{ secrets.APPLE_TEAM_ID }} + + if [ ${{ env.WAIT_FOR_NOTARIZE }} ]; then + xcrun stapler staple "./bundle/${{ steps.bundle.outputs.artifact }}" + fi + + - uses: actions/upload-artifact@v5 + with: + name: ${{ steps.bundle.outputs.artifact }} + path: ./bundle/${{ steps.bundle.outputs.artifact }} + if-no-files-found: error + retention-days: ${{ inputs.retention-days }} diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 725ea5a7..62b3a343 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -6,113 +6,77 @@ name: build on: workflow_call: inputs: - version_override: + libation-version: type: string - description: "Version number override" - required: false - run_unit_tests: - type: boolean - description: "Skip running unit tests" - required: false - default: true - architecture: - type: string - description: "CPU architecture targeted by the build." required: true - -env: - DOTNET_CONFIGURATION: "Release" - DOTNET_VERSION: "9.0.x" + dotnet-version: + type: string + required: true + run-unit-tests: + type: boolean + publish-r2r: + type: boolean + retention-days: + type: number jobs: build: - name: "${{ matrix.os }}-${{ matrix.release_name }}-${{ inputs.architecture }}" + name: "Windows-${{ matrix.release_name }}-x64" runs-on: windows-latest - env: - OUTPUT_NAME: "${{ matrix.os }}-${{ matrix.release_name }}-${{ inputs.architecture }}" - RUNTIME_ID: "win-${{ inputs.architecture }}" strategy: matrix: - os: [Windows] ui: [Avalonia] release_name: [chardonnay] include: - - os: Windows - ui: WinForms + - ui: WinForms release_name: classic prefix: Classic- steps: - uses: actions/checkout@v5 - - name: Setup .NET - uses: actions/setup-dotnet@v5 + + - uses: actions/setup-dotnet@v5 with: - dotnet-version: ${{ env.DOTNET_VERSION }} - env: - NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get version - id: get_version - run: | - if ("${{ inputs.version_override }}".length -gt 0) { - $version = "${{ inputs.version_override }}" - } else { - $version = (Select-Xml -Path "./Source/AppScaffolding/AppScaffolding.csproj" -XPath "/Project/PropertyGroup/Version").Node.InnerXML.Trim() - } - "version=$version" >> $env:GITHUB_OUTPUT + dotnet-version: ${{ inputs.dotnet-version }} + dotnet-quality: "ga" - name: Unit test - if: ${{ inputs.run_unit_tests }} + if: ${{ inputs.run-unit-tests }} working-directory: ./Source run: dotnet test - + - name: Publish working-directory: ./Source run: | - dotnet publish ` - Libation${{ matrix.ui }}/Libation${{ matrix.ui }}.csproj ` - --runtime ${{ env.RUNTIME_ID }} ` - --configuration ${{ env.DOTNET_CONFIGURATION }} ` - --output bin/Publish/${{ env.OUTPUT_NAME }} ` - -p:PublishProfile=Libation${{ matrix.ui }}/Properties/PublishProfiles/${{ matrix.os }}Profile.pubxml - dotnet publish ` - LoadByOS/${{ matrix.os }}ConfigApp/${{ matrix.os }}ConfigApp.csproj ` - --runtime ${{ env.RUNTIME_ID }} ` - --configuration ${{ env.DOTNET_CONFIGURATION }} ` - --output bin/Publish/${{ env.OUTPUT_NAME }} ` - -p:PublishProfile=LoadByOS/${{ matrix.os }}ConfigApp/PublishProfiles/${{ matrix.os }}Profile.pubxml - dotnet publish ` - LibationCli/LibationCli.csproj ` - --runtime ${{ env.RUNTIME_ID }} ` - --configuration ${{ env.DOTNET_CONFIGURATION }} ` - --output bin/Publish/${{ env.OUTPUT_NAME }} ` - -p:DefineConstants="${{ matrix.release_name }}" ` - -p:PublishProfile=LibationCli/Properties/PublishProfiles/${{ matrix.os }}Profile.pubxml - dotnet publish ` - Hangover${{ matrix.ui }}/Hangover${{ matrix.ui }}.csproj ` - --runtime ${{ env.RUNTIME_ID }} ` - --configuration ${{ env.DOTNET_CONFIGURATION }} ` - --output bin/Publish/${{ env.OUTPUT_NAME }} ` - -p:PublishProfile=Hangover${{ matrix.ui }}/Properties/PublishProfiles/${{ matrix.os }}Profile.pubxml + $PUBLISH_ARGS=@( + "--runtime", "win-x64", + "--configuration", "Release", + "--output", "../bin", + "-p:PublishProtocol=FileSystem", + "-p:PublishReadyToRun=${{ inputs.publish-r2r }}", + "-p:SelfContained=true") + + dotnet publish "Libation${{ matrix.ui }}/Libation${{ matrix.ui }}.csproj" $PUBLISH_ARGS + dotnet publish "LoadByOS/WindowsConfigApp/WindowsConfigApp.csproj" $PUBLISH_ARGS + dotnet publish "LibationCli/LibationCli.csproj" $PUBLISH_ARGS + dotnet publish "Hangover${{ matrix.ui }}/Hangover${{ matrix.ui }}.csproj" $PUBLISH_ARGS - name: Zip artifact id: zip - working-directory: ./Source/bin/Publish + working-directory: ./bin run: | - $bin_dir = "${{ env.OUTPUT_NAME }}\" $delfiles = @( "WindowsConfigApp.exe", "WindowsConfigApp.runtimeconfig.json", - "WindowsConfigApp.deps.json" - ) - foreach ($file in $delfiles){ if (test-path $bin_dir$file){ Remove-Item $bin_dir$file } } - $artifact="${{ matrix.prefix }}Libation.${{ steps.get_version.outputs.version }}-" + "${{ matrix.os }}".ToLower() + "-${{ matrix.release_name }}-${{ inputs.architecture }}" + "WindowsConfigApp.deps.json") + + foreach ($file in $delfiles){ if (test-path $file){ Remove-Item $file } } + $artifact="${{ matrix.prefix }}Libation.${{ inputs.libation-version }}-windows-${{ matrix.release_name }}-x64.zip" "artifact=$artifact" >> $env:GITHUB_OUTPUT - Compress-Archive -Path "${bin_dir}*" -DestinationPath "$artifact.zip" + Compress-Archive -Path * -DestinationPath "$artifact" - - name: Publish artifact - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v5 with: - name: ${{ steps.zip.outputs.artifact }}.zip - path: ./Source/bin/Publish/${{ steps.zip.outputs.artifact }}.zip + name: ${{ steps.zip.outputs.artifact }} + path: ./bin/${{ steps.zip.outputs.artifact }} if-no-files-found: error - retention-days: 7 + retention-days: ${{ inputs.retention-days }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 341f8033..9880c23d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,26 +6,47 @@ name: build on: workflow_call: inputs: - version_override: + libation-version: type: string - description: "Version number override" - required: false - run_unit_tests: + description: "Libation version number" + required: true + dotnet-version: + type: string + default: "9.x" + description: ".NET version to target" + run-unit-tests: type: boolean - description: "Skip running unit tests" - required: false - default: true + description: "Whether to run unit tests prior to publishing." + publish-r2r: + type: boolean + description: "Whether to publish assemblies as ReadyToRun." + retention-days: + type: number + description: "Number of days the artifacts are to be retained." -jobs: +jobs: windows: - strategy: - matrix: - architecture: [x64] uses: ./.github/workflows/build-windows.yml with: - version_override: ${{ inputs.version_override }} - run_unit_tests: ${{ inputs.run_unit_tests }} + libation-version: ${{ inputs.libation-version }} + dotnet-version: ${{ inputs.dotnet-version }} + run-unit-tests: ${{ inputs.run-unit-tests }} + publish-r2r: ${{ inputs.publish-r2r }} + retention-days: ${{ inputs.retention-days }} + + macOS: + strategy: + matrix: + architecture: [x64, arm64] + uses: ./.github/workflows/build-mac.yml + with: + libation-version: ${{ inputs.libation-version }} + dotnet-version: ${{ inputs.dotnet-version }} + run-unit-tests: ${{ inputs.run-unit-tests }} + publish-r2r: ${{ inputs.publish-r2r }} + retention-days: ${{ inputs.retention-days }} architecture: ${{ matrix.architecture }} + secrets: inherit linux: strategy: @@ -34,20 +55,11 @@ jobs: architecture: [x64, arm64] uses: ./.github/workflows/build-linux.yml with: - version_override: ${{ inputs.version_override }} - runs_on: ubuntu-latest + libation-version: ${{ inputs.libation-version }} + dotnet-version: ${{ inputs.dotnet-version }} + run-unit-tests: ${{ inputs.run-unit-tests }} + publish-r2r: ${{ inputs.publish-r2r }} + retention-days: ${{ inputs.retention-days }} + architecture: ${{ matrix.architecture }} OS: ${{ matrix.OS }} - architecture: ${{ matrix.architecture }} - run_unit_tests: ${{ inputs.run_unit_tests }} - macos: - strategy: - matrix: - architecture: [x64, arm64] - uses: ./.github/workflows/build-linux.yml - with: - version_override: ${{ inputs.version_override }} - runs_on: macos-latest - OS: MacOS - architecture: ${{ matrix.architecture }} - run_unit_tests: ${{ inputs.run_unit_tests }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 244b6e75..867f56e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: - "v*" jobs: prerelease: - runs-on: ubuntu-latest + runs-on: ubuntu-slim outputs: version: ${{ steps.get_version.outputs.version }} steps: @@ -31,9 +31,10 @@ jobs: build: needs: [prerelease] uses: ./.github/workflows/build.yml + secrets: inherit with: - version_override: ${{ needs.prerelease.outputs.version }} - run_unit_tests: false + libation-version: ${{ needs.prerelease.outputs.version }} + publish-r2r: true release: needs: [prerelease, build] diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 27abc275..89877043 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,12 +10,30 @@ on: branches: [master] jobs: + get_version: + runs-on: ubuntu-slim + outputs: + version: ${{ steps.get_version.outputs.version }} + steps: + - name: Get version + id: get_version + run: | + wget "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/Source/AppScaffolding/AppScaffolding.csproj" + version="$(grep -Eio -m 1 '.*' ./AppScaffolding.csproj | sed -r 's/<\/?Version>//g')" + echo "version=${version}" >> "${GITHUB_OUTPUT}" build: + needs: [get_version] uses: ./.github/workflows/build.yml + with: + libation-version: ${{ needs.get_version.outputs.version }} + retention-days: 14 + run-unit-tests: true + docker: + needs: [get_version] uses: ./.github/workflows/docker.yml with: - version: ${GITHUB_SHA} + version: ${{ needs.get_version.outputs.version }} release: false secrets: docker_username: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/Scripts/Bundle_Debian.sh b/Scripts/Bundle_Debian.sh index b69eb76f..2a5d5034 100644 --- a/Scripts/Bundle_Debian.sh +++ b/Scripts/Bundle_Debian.sh @@ -28,14 +28,6 @@ then exit fi -contains() { case "$1" in *"$2"*) true ;; *) false ;; esac } - -if ! contains "$BIN_DIR" "$ARCH" -then - echo "This script must be called with a Libation binaries for ${ARCH}." - exit -fi - ARCH=$(echo $ARCH | sed 's/x64/amd64/') DEB_DIR=./deb diff --git a/Scripts/Bundle_MacOS.sh b/Scripts/Bundle_MacOS.sh index 7b5f6a0b..09bd9d03 100644 --- a/Scripts/Bundle_MacOS.sh +++ b/Scripts/Bundle_MacOS.sh @@ -3,6 +3,7 @@ BIN_DIR=$1; shift VERSION=$1; shift ARCH=$1; shift +SIGN_WITH_KEY=$1; shift if [ -z "$BIN_DIR" ] then @@ -28,12 +29,9 @@ then exit fi -contains() { case "$1" in *"$2"*) true ;; *) false ;; esac } - -if ! contains "$BIN_DIR" $ARCH +if [ "$SIGN_WITH_KEY" != "true" ] then - echo "This script must be called with a Libation binaries for ${ARCH}." - exit + echo "[WARNING] App will fail Gatekeeper verification without valid Apple Team information." fi BUNDLE=./Libation.app @@ -74,6 +72,16 @@ mv $BUNDLE_MACOS/libation.icns $BUNDLE_RESOURCES/libation.icns echo "Moving Info.plist file..." mv $BUNDLE_MACOS/Info.plist $BUNDLE_CONTENTS/Info.plist +echo "Moving Libation_DS_Store file..." +mv $BUNDLE_MACOS/Libation_DS_Store ./Libation_DS_Store + +echo "Moving background.png file..." +mv $BUNDLE_MACOS/background.png ./background.png + +echo "Moving background.png file..." +mv $BUNDLE_MACOS/Libation.entitlements ./Libation.entitlements +ENTITLEMENTS="./Libation.entitlements" + PLIST_ARCH=$(echo $ARCH | sed 's/x64/x86_64/') echo "Set LSArchitecturePriority to $PLIST_ARCH" sed -i -e "s/ARCHITECTURE_STRING/$PLIST_ARCH/" $BUNDLE_CONTENTS/Info.plist @@ -81,27 +89,40 @@ sed -i -e "s/ARCHITECTURE_STRING/$PLIST_ARCH/" $BUNDLE_CONTENTS/Info.plist echo "Set CFBundleVersion to $VERSION" sed -i -e "s/VERSION_STRING/$VERSION/" $BUNDLE_CONTENTS/Info.plist - delfiles=('MacOSConfigApp' 'MacOSConfigApp.deps.json' 'MacOSConfigApp.runtimeconfig.json') - for n in "${delfiles[@]}" do echo "Deleting $n" rm $BUNDLE_MACOS/$n done -APP_FILE=Libation.${VERSION}-macOS-chardonnay-${ARCH}.tgz +DMG_FILE="Libation.${VERSION}-macOS-chardonnay-${ARCH}.dmg" -echo "Signing executables in: $BUNDLE" -codesign --force --deep -s - $BUNDLE +all_identities=$(security find-identity -v -p codesigning) +identity=$(echo ${all_identities} | sed -n 's/.*"\(.*\)".*/\1/p') -echo "Creating app bundle: $APP_FILE" -tar -czvf $APP_FILE $BUNDLE +if [ "$SIGN_WITH_KEY" == "true" ]; then + echo "Signing executables in: $BUNDLE" + codesign --force --deep --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "${identity}" "$BUNDLE" + codesign --verify --verbose "$BUNDLE" +else + echo "Signing with empty key: $BUNDLE" + codesign --force --deep -s - $BUNDLE +fi -mkdir bundle -echo "moving to ./bundle/$APP_FILE" -mv $APP_FILE ./bundle/$APP_FILE +echo "Creating app disk image: $DMG_FILE" +mkdir Libation +mv $BUNDLE ./Libation/$BUNDLE +mv Libation_DS_Store Libation/.DS_Store +mkdir Libation/.background +mv background.png Libation/.background/ +ln -s /Applications "./Libation/ " +mkdir ./bundle +hdiutil create -srcFolder ./Libation -o "./bundle/$DMG_FILE" -rm -r $BUNDLE +if [ "$SIGN_WITH_KEY" == "true" ]; then + echo "Signing $DMG_FILE" + codesign --deep --sign "${identity}" "./bundle/$DMG_FILE" +fi echo "Done!" diff --git a/Scripts/Bundle_Redhat.sh b/Scripts/Bundle_Redhat.sh index 05d27ac6..e79009f9 100644 --- a/Scripts/Bundle_Redhat.sh +++ b/Scripts/Bundle_Redhat.sh @@ -28,14 +28,6 @@ then exit fi -contains() { case "$1" in *"$2"*) true ;; *) false ;; esac } - -if ! contains "$BIN_DIR" "$ARCH" -then - echo "This script must be called with a Libation binaries for ${ARCH}." - exit -fi - BASEDIR=$(pwd) delfiles=('LinuxConfigApp' 'LinuxConfigApp.deps.json' 'LinuxConfigApp.runtimeconfig.json') diff --git a/Source/LoadByOS/MacOSConfigApp/Info.plist b/Source/LoadByOS/MacOSConfigApp/Info.plist index b9d85062..9452340a 100644 --- a/Source/LoadByOS/MacOSConfigApp/Info.plist +++ b/Source/LoadByOS/MacOSConfigApp/Info.plist @@ -1,7 +1,6 @@ - CFBundleExecutable Libation @@ -19,17 +18,5 @@ libation.icns CFBundleVersion VERSION_STRING - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.cs.allow-unsigned-executable-memory - - com.apple.security.cs.disable-library-validation - - com.apple.security.cs.disable-executable-page-protection - - com.apple.security.automation.apple-events - \ No newline at end of file diff --git a/Source/LoadByOS/MacOSConfigApp/Libation.entitlements b/Source/LoadByOS/MacOSConfigApp/Libation.entitlements new file mode 100644 index 00000000..61d4c457 --- /dev/null +++ b/Source/LoadByOS/MacOSConfigApp/Libation.entitlements @@ -0,0 +1,20 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-library-validation + + com.apple.security.cs.disable-executable-page-protection + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.automation.apple-events + + + diff --git a/Source/LoadByOS/MacOSConfigApp/Libation_DS_Store b/Source/LoadByOS/MacOSConfigApp/Libation_DS_Store new file mode 100644 index 00000000..8134a5e7 Binary files /dev/null and b/Source/LoadByOS/MacOSConfigApp/Libation_DS_Store differ diff --git a/Source/LoadByOS/MacOSConfigApp/MacOSConfigApp.csproj b/Source/LoadByOS/MacOSConfigApp/MacOSConfigApp.csproj index 063474a9..e4dca926 100644 --- a/Source/LoadByOS/MacOSConfigApp/MacOSConfigApp.csproj +++ b/Source/LoadByOS/MacOSConfigApp/MacOSConfigApp.csproj @@ -30,15 +30,27 @@ + + Always + Always Always + + Always + + + Always + Always + + Always + \ No newline at end of file diff --git a/Source/LoadByOS/MacOSConfigApp/background.png b/Source/LoadByOS/MacOSConfigApp/background.png new file mode 100644 index 00000000..c74f1ae5 Binary files /dev/null and b/Source/LoadByOS/MacOSConfigApp/background.png differ