diff --git a/.github/pkl-workflows/GithubAction/GithubAction.pkl b/.github/pkl-workflows/GithubAction/GithubAction.pkl index 776b54d2f0..d99ca79acd 100644 --- a/.github/pkl-workflows/GithubAction/GithubAction.pkl +++ b/.github/pkl-workflows/GithubAction/GithubAction.pkl @@ -569,6 +569,7 @@ abstract class JobBase { outputs: Mapping? `timeout-minutes`: Int? permissions: (*Permissions|"read-all"|"write-all")? + environment: String? } abstract class StepJobBase extends JobBase { diff --git a/.github/pkl-workflows/codeql.pkl b/.github/pkl-workflows/codeql.pkl index 6782585e7c..d738695978 100644 --- a/.github/pkl-workflows/codeql.pkl +++ b/.github/pkl-workflows/codeql.pkl @@ -53,8 +53,10 @@ jobs { queries: - uses: security-and-quality query-filters: - - exclude: cs/call-to-unmanaged-code - - exclude: cs/unmanaged-code + - exclude: + id: cs/call-to-unmanaged-code + - exclude: + id: cs/unmanaged-code """ } } diff --git a/.github/pkl-workflows/helpers/Actions.pkl b/.github/pkl-workflows/helpers/Actions.pkl index 902280a632..c7cf608298 100644 --- a/.github/pkl-workflows/helpers/Actions.pkl +++ b/.github/pkl-workflows/helpers/Actions.pkl @@ -17,3 +17,6 @@ const restoreCache = "actions/cache/restore@v4" const cache = "actions/cache@v4" const codeQLInit = "github/codeql-action/init@a57c67b89589d2d13d5ac85a9fc4679c7539f94c" const codeQLAnalyze = "github/codeql-action/analyze@a57c67b89589d2d13d5ac85a9fc4679c7539f94c" +const findPR = "juliangruber/find-pull-request-action@48b6133aa6c826f267ebd33aa2d29470f9d9e7d0" // 1.9.0 +const mergePR = "juliangruber/merge-pull-request-action@9234b8714dda9a08f3d1df5b2a6a3abd7b695353" // 1.3.1 +const publishGithubRelease = "ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5" // 1.14.0 diff --git a/.github/pkl-workflows/helpers/Package.pkl b/.github/pkl-workflows/helpers/Package.pkl index d21e5d21b5..a8ffd837f3 100644 --- a/.github/pkl-workflows/helpers/Package.pkl +++ b/.github/pkl-workflows/helpers/Package.pkl @@ -16,7 +16,7 @@ function nuget(shouldBuildDocsCondition: String): gha.Job = new gha.Job { name = "Package NuGet" `runs-on` = new gha.WindowsLatest{} outputs { - [Steps.getVersionOutput] = "${{ steps.\(Steps.getVersionStepName).outputs.\(Steps.getVersionOutput) }}" + [Steps.getVersionOutput] = Steps.getVersionExpresssion } `timeout-minutes` = 30 steps { @@ -26,7 +26,7 @@ function nuget(shouldBuildDocsCondition: String): gha.Job = new gha.Job { setVersionSuffix ...Steps.fetchWrappers(null) ...Steps.msbuild(new Steps.MSBuildConfig { - projects = Common.nugetPackages.map((pkg) -> "Realm/\(pkg)").toListing() + projects = Common.packages.map((pkg) -> "Realm/\(pkg)").toListing() target = "Pack" properties { ["PackageOutputPath"] = "${{ github.workspace }}/Realm/packages" @@ -34,8 +34,8 @@ function nuget(shouldBuildDocsCondition: String): gha.Job = new gha.Job { } }) Steps.readVersionFromPackage() - for (pkgName in Common.nugetPackages) { - let (finalPkgName = "\(pkgName).${{ steps.\(Steps.getVersionStepName).outputs.\(Steps.getVersionOutput) }}") + for (pkgName in Common.packages) { + let (finalPkgName = "\(pkgName).\(Steps.getVersionExpresssion)") Steps.uploadArtifacts(finalPkgName, "Realm/packages/\(finalPkgName).*nupkg") } Steps.uploadArtifacts("ExtractedChangelog", "Realm/Realm/ExtractedChangelog.md") diff --git a/.github/pkl-workflows/helpers/Steps.pkl b/.github/pkl-workflows/helpers/Steps.pkl index 01f5a29473..666529cd87 100644 --- a/.github/pkl-workflows/helpers/Steps.pkl +++ b/.github/pkl-workflows/helpers/Steps.pkl @@ -5,6 +5,8 @@ import "Actions.pkl" const getVersionStepName = "get-version" const getVersionOutput = "package_version" +const getVersionExpresssion = "${{ steps.\(getVersionStepName).outputs.\(getVersionOutput) }}" + const function checkout(submodules: (Boolean | "recursive")): Listing = new Listing { checkoutWithoutMatchers(submodules) registerProblemMatchers() @@ -126,7 +128,7 @@ const function setupAndroid(): Listing = new Listing { } } -const function configureAWSCredentials(accessKey: String, secretKey: String, region: "us-east-1" | "us-west-2"): gha.Step = new { +const function configureAWSCredentials(accessKey: String, secretKey: String, region: "us-east-1" | "us-west-2" | "us-east-2"): gha.Step = new { name = "Configure AWS Credentials" uses = Actions.awsConfigureCredentials with { @@ -148,7 +150,7 @@ const function readVersionFromPackage(): gha.Step = new { } const function uploadToNPM(tag: "latest" | "alpha"): Listing = new Listing { - local packageName = "io.realm.unity-${{ steps.\(getVersionStepName).outputs.\(getVersionOutput) }}.tgz" + local packageName = "io.realm.unity-\(getVersionExpresssion).tgz" new gha.Step { uses = Actions.setupNode diff --git a/.github/pkl-workflows/helpers/Test.pkl b/.github/pkl-workflows/helpers/Test.pkl index d416250a90..eea7cf411b 100644 --- a/.github/pkl-workflows/helpers/Test.pkl +++ b/.github/pkl-workflows/helpers/Test.pkl @@ -395,6 +395,7 @@ function unity(config: UnityTestConfig): Mapping = new Mapping< } needs { Common.job_Packages + Common.job_Unity } `timeout-minutes` = 30 `if` = Common.ifNotCanceledCondition diff --git a/.github/pkl-workflows/publish-prerelease.pkl b/.github/pkl-workflows/publish-prerelease.pkl index ec3307b3f5..e553e7ade4 100644 --- a/.github/pkl-workflows/publish-prerelease.pkl +++ b/.github/pkl-workflows/publish-prerelease.pkl @@ -4,7 +4,6 @@ amends "GithubAction/GithubAction.pkl" import "helpers/Common.pkl" import "helpers/Steps.pkl" -import "helpers/Actions.pkl" name = "Publish Prerelease" on { @@ -26,7 +25,7 @@ jobs { Steps.configureAWSCredentials("NUGET_S3_ACCESS_KEY", "NUGET_S3_SECRET_KEY", "us-east-1") for (package in Common.nugetPackages) { - let (packageWithVersion = "\(package).${{ steps.\(Steps.getVersionStepName).outputs.\(Steps.getVersionOutput) }}") + let (packageWithVersion = "\(package).\(Steps.getVersionExpresssion)") new Step { name = "NuGet Publish \(packageWithVersion)" run = "sleet push ${{ github.workspace }}/Realm/packages/\(packageWithVersion)/\(packageWithVersion).nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c3e23fa31d..a7d2f8b2bf 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,8 +42,10 @@ jobs: queries: - uses: security-and-quality query-filters: - - exclude: cs/call-to-unmanaged-code - - exclude: cs/unmanaged-code + - exclude: + id: cs/call-to-unmanaged-code + - exclude: + id: cs/unmanaged-code - name: Setup JDK uses: actions/setup-java@2e74cbce18569d23ca8b812590dbb83f13ac7c5a with: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1a7f9be055..e50e7f65b2 100755 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -210,6 +210,10 @@ jobs: run: msbuild Realm/Realm -t:Pack -restore -p:Configuration=Release -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Build Realm/Realm.PlatformHelpers run: msbuild Realm/Realm.PlatformHelpers -t:Pack -restore -p:Configuration=Release -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} + - name: Build Realm/Realm.UnityUtils + run: msbuild Realm/Realm.UnityUtils -t:Pack -restore -p:Configuration=Release -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} + - name: Build Realm/Realm.UnityWeaver + run: msbuild Realm/Realm.UnityWeaver -t:Pack -restore -p:Configuration=Release -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Read version id: get-version run: |- @@ -231,6 +235,20 @@ jobs: path: Realm/packages/Realm.PlatformHelpers.${{ steps.get-version.outputs.package_version }}.*nupkg retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }} if-no-files-found: error + - name: Store artifacts for Realm.UnityUtils.${{ steps.get-version.outputs.package_version }} + uses: actions/upload-artifact@v4 + with: + name: Realm.UnityUtils.${{ steps.get-version.outputs.package_version }} + path: Realm/packages/Realm.UnityUtils.${{ steps.get-version.outputs.package_version }}.*nupkg + retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }} + if-no-files-found: error + - name: Store artifacts for Realm.UnityWeaver.${{ steps.get-version.outputs.package_version }} + uses: actions/upload-artifact@v4 + with: + name: Realm.UnityWeaver.${{ steps.get-version.outputs.package_version }} + path: Realm/packages/Realm.UnityWeaver.${{ steps.get-version.outputs.package_version }}.*nupkg + retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }} + if-no-files-found: error - name: Store artifacts for ExtractedChangelog uses: actions/upload-artifact@v4 with: @@ -314,6 +332,7 @@ jobs: name: Build Unity linux needs: - build-packages + - build-unity if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') timeout-minutes: 30 runs-on: @@ -392,6 +411,7 @@ jobs: name: Build Unity windows needs: - build-packages + - build-unity if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') timeout-minutes: 30 runs-on: