diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..c1eea37 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @thehairy \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9960204 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..41e3920 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,182 @@ +name: Build and Release App + +on: + push: + branches: + - main + paths-ignore: + - '**/*.md' + - '**.github/workflows/*' + workflow_dispatch: + +permissions: + contents: write + # pages: write + # id-token: write + +# concurrency: +# group: "pages" +# cancel-in-progress: false + +jobs: + release: + runs-on: macos-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Xcode Select Version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.2' + + # - name: Setup Certificate + # uses: apple-actions/import-codesign-certs@v2 + # with: + # p12-file-base64: ${{ secrets.P12_CERTIFICATE_BASE64 }} + # p12-password: ${{ secrets.P12_PASSWORD }} + + - name: Setup get-next-version + run: | + curl -L -o get-next-version https://github.com/thenativeweb/get-next-version/releases/download/2.6.3/get-next-version-darwin-arm64 + chmod a+x get-next-version + sudo mv get-next-version /usr/local/bin + + - name: Get Next Version + id: get_next_version + run: | + OUTPUT=$(get-next-version --target json) + NEXT_VERSION=$(echo $OUTPUT | jq -r '.version') + CURRENT_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") + echo "version=$NEXT_VERSION" >> $GITHUB_OUTPUT + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + + - name: Bump version in Config.xcconfig + run: | + CURRENT_BUILD=$(grep BUILD_NUMBER iRPC/Config.xcconfig | cut -d ' ' -f 3) + NEW_BUILD=$((CURRENT_BUILD + 1)) + sed -i '' "s/BUILD_NUMBER = $CURRENT_BUILD/BUILD_NUMBER = $NEW_BUILD/" iRPC/Config.xcconfig + + CURRENT_VERSION=$(grep VERSION iRPC/Config.xcconfig | cut -d ' ' -f 3) + NEW_VERSION=${{ steps.get_next_version.outputs.version }} + sed -i '' "s/VERSION = $CURRENT_VERSION/VERSION = $NEW_VERSION/" iRPC/Config.xcconfig + + - name: Build Changelog + uses: dlavrenuek/conventional-changelog-action@v1.2.3 + id: changelog + with: + from: ${{ steps.get_next_version.outputs.current_version }} + to: HEAD + + - name: Write Changelog + run: echo "${{ steps.changelog.outputs.body }}" > RELEASE.md + + - name: Build macOS app + run: xcodebuild archive -scheme "iRPC" -configuration "Release" -archivePath "build/iRPC.xcarchive" -destination "generic/platform=macOS,name=Any Mac" CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO "OTHER_SWIFT_FLAGS=${inherited} -D GITHUB_RELEASE" | xcbeautify + + # - name: Sign, Package and Notarize .app + # run: | + # cp -R "build/iRPC.xcarchive/Products/Applications/"*.app "build/iRPC.app" + # cd build + # codesign -s "Developer ID Application" -f --timestamp -o runtime --deep "iRPC.app/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices/Downloader.xpc/Contents/MacOS/Downloader" + # codesign -s "Developer ID Application" -f --timestamp -o runtime --deep "iRPC.app/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices/Installer.xpc/Contents/MacOS/Installer" + # codesign -s "Developer ID Application" -f --timestamp -o runtime --deep "iRPC.app/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app/Contents/MacOS/Updater" + # codesign -s "Developer ID Application" -f --timestamp -o runtime --deep "iRPC.app/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate" + # codesign -s "Developer ID Application" -f --timestamp -o runtime --deep "iRPC.app/Contents/MacOS/iRPC" + # codesign -s "Developer ID Application" -f --timestamp -o runtime --deep "iRPC.app" + # npm install --global create-dmg + # create-dmg "iRPC.app" --overwrite + # mv *.dmg iRPC.dmg + # DMG_FILE="iRPC.dmg" + # echo "DMG_FILE=$DMG_FILE" >> $GITHUB_ENV + # xcrun notarytool submit "$DMG_FILE" --wait --apple-id "${{ secrets.NOTARIZATION_USERNAME }}" --password "${{ secrets.NOTARIZATION_PASSWORD }}" --team-id "L988J7YMK5" + # xcrun stapler staple "$DMG_FILE" + + # - name: Configure Sparkle + # run: | + # curl -L -o Sparkle-2.4.2.tar.xz https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz + # tar -xJf Sparkle-2.4.2.tar.xz + # mkdir update + # mv "./build/$DMG_FILE" update/ + # echo "${{ steps.changelog.outputs.body }}" > RELEASE.md + # chmod +x ./bin/generate_appcast + + # - name: Convert Markdown to HTML + # uses: jaywcjlove/markdown-to-html-cli@main + # with: + # source: RELEASE.md + # output: ./update/${DMG_FILE%.dmg}.html + # github-corners: false + + # - name: Generate appcast.xml + # run: echo "$EDDSA_PRIVATE_KEY" | ./bin/generate_appcast --ed-key-file - --link https://iRPCmac.app --embed-release-notes --download-url-prefix https://github.com/castdrian/iRPC/releases/latest/download/ update/ + # env: + # EDDSA_PRIVATE_KEY: ${{ secrets.EDDSA_PRIVATE_KEY }} + # ARCHIVES_SOURCE_DIR: . + + # - name: Archive appcast.xml as artifact + # uses: actions/upload-artifact@v4 + # with: + # name: appcast + # path: ./update/appcast.xml + + - name: Create App Archive + run: | + cp -R "build/iRPC.xcarchive/Products/Applications/"*.app "iRPC.app" + zip -r iRPC.zip iRPC.app + rm -rf iRPC.app + + - name: Commit & Push changes + uses: EndBug/add-and-commit@v9 + with: + add: 'iRPC/Config.xcconfig' + default_author: github_actions + fetch: false + message: 'Bump version [skip ci]' + push: true + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.get_next_version.outputs.version }} + body_path: RELEASE.md + files: iRPC.zip + fail_on_unmatched_files: true + token: ${{ env.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # pages: + # environment: + # name: github-pages + # url: ${{ steps.deployment.outputs.page_url }} + # runs-on: ubuntu-latest + # needs: release + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: Download appcast.xml artifact + # uses: actions/download-artifact@v4 + # with: + # name: appcast + # path: ./ + + # - name: Setup Pages + # uses: actions/configure-pages@v3 + + # - name: Build with Jekyll + # uses: actions/jekyll-build-pages@v1 + # with: + # source: ./ + # destination: ./_site + + # - name: Upload artifact + # uses: actions/upload-pages-artifact@v3 + + # - name: Deploy to GitHub Pages + # id: deployment + # uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/iRPC.xcodeproj/project.pbxproj b/iRPC.xcodeproj/project.pbxproj index 15c3b39..4fbe5e5 100644 --- a/iRPC.xcodeproj/project.pbxproj +++ b/iRPC.xcodeproj/project.pbxproj @@ -260,13 +260,15 @@ }; F4BE1C3E2DC94AD6009B622C /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReferenceAnchor = F4BE1C332DC94AD5009B622C /* iRPC */; + baseConfigurationReferenceRelativePath = Config.xcconfig; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = iRPC/iRPC.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = "$(BUILD_NUMBER)"; DEVELOPMENT_TEAM = F2VS4PRAT5; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; @@ -278,7 +280,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = "$(VERSION)"; PRODUCT_BUNDLE_IDENTIFIER = dev.stabenow.iRPC; PRODUCT_NAME = "$(TARGET_NAME)"; REGISTER_APP_GROUPS = YES; @@ -289,13 +291,15 @@ }; F4BE1C3F2DC94AD6009B622C /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReferenceAnchor = F4BE1C332DC94AD5009B622C /* iRPC */; + baseConfigurationReferenceRelativePath = Config.xcconfig; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = iRPC/iRPC.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = "$(BUILD_NUMBER)"; DEVELOPMENT_TEAM = F2VS4PRAT5; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; @@ -307,7 +311,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = "$(VERSION)"; PRODUCT_BUNDLE_IDENTIFIER = dev.stabenow.iRPC; PRODUCT_NAME = "$(TARGET_NAME)"; REGISTER_APP_GROUPS = YES; diff --git a/iRPC.xcodeproj/project.xcworkspace/xcuserdata/adrian.xcuserdatad/UserInterfaceState.xcuserstate b/iRPC.xcodeproj/project.xcworkspace/xcuserdata/adrian.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..4a60fdf Binary files /dev/null and b/iRPC.xcodeproj/project.xcworkspace/xcuserdata/adrian.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iRPC.xcodeproj/xcuserdata/adrian.xcuserdatad/xcschemes/xcschememanagement.plist b/iRPC.xcodeproj/xcuserdata/adrian.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..117d061 --- /dev/null +++ b/iRPC.xcodeproj/xcuserdata/adrian.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + iRPC.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/iRPC/Config.xcconfig b/iRPC/Config.xcconfig new file mode 100644 index 0000000..623fbc7 --- /dev/null +++ b/iRPC/Config.xcconfig @@ -0,0 +1,12 @@ +// +// Config.xcconfig +// iRPC +// +// Created by Adrian Castro on 7/5/25. +// + +// Configuration settings file format documentation can be found at: +// https://developer.apple.com/documentation/xcode/adding-a-build-configuration-file-to-your-project + +BUILD_NUMBER = 1 +VERSION = 1.0.0 diff --git a/iRPC/iRPCApp.swift b/iRPC/iRPCApp.swift index b0eb333..34aad16 100644 --- a/iRPC/iRPCApp.swift +++ b/iRPC/iRPCApp.swift @@ -12,5 +12,8 @@ struct iRPCApp: App { @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate var body: some Scene { + WindowGroup { + EmptyView() + } } }