diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index 8f8f4149..e4481bca 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -22,6 +22,8 @@ jobs: delete-pre-releases: name: Delete Unnecessary Pre-Releases runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/Dockerfile b/Dockerfile index 42b5a153..4ae1fb57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ #tag 8.0-alpine FROM mcr.microsoft.com/dotnet/aspnet@sha256:646b1c5ff36375f35f6149b0ce19ca095f97b4b882b90652801e9fbe82bcfa8a LABEL maintainer="Ed-Fi Alliance, LLC and Contributors " -ENV VERSION="2.3.2" +ENV VERSION="2.3.3" ENV TZ=${TIME_ZONE} # Alpine image does not contain Globalization Cultures library so we need to install ICU library to get fopr LINQ expression to work diff --git a/Installer/install.ps1 b/Installer/install.ps1 index 26e9850c..7193e8f4 100644 --- a/Installer/install.ps1 +++ b/Installer/install.ps1 @@ -45,14 +45,14 @@ Configure DataImport $p = @{ ToolsPath = "C:/temp/tools" DbConnectionInfo = $dbConnectionInfo - PackageVersion = '2.3.2.0' + PackageVersion = '2.3.3.0' } UserRecoveryToken is optional. This value can be used to recover/ reset the application user credentials $p = @{ ToolsPath = "C:/temp/tools" DbConnectionInfo = $dbConnectionInfo - PackageVersion = '2.3.2.0' + PackageVersion = '2.3.3.0' UserRecoveryToken = "bEnFYNociET2R1Wua3DHzwfU5u" } #> @@ -62,7 +62,7 @@ $packageSource = Split-Path $PSScriptRoot -Parent $p = @{ ToolsPath = "C:/temp/tools" DbConnectionInfo = $dbConnectionInfo - PackageVersion = '2.3.2.0' + PackageVersion = '2.3.3.0' PackageSource = $packageSource } diff --git a/eng/promote-packages.psm1 b/eng/promote-packages.psm1 new file mode 100644 index 00000000..07bdf4fb --- /dev/null +++ b/eng/promote-packages.psm1 @@ -0,0 +1,72 @@ +# SPDX-License-Identifier: Apache-2.0 +# Licensed to the Ed-Fi Alliance under one or more agreements. +# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. +# See the LICENSE and NOTICES files in the project root for more information. + +$ErrorActionPreference = "Stop" +<# +.DESCRIPTION +Promotes a package in Azure Artifacts to a view, e.g. pre-release or release. +#> +function Invoke-Promote { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '', Justification = 'False positive')] + param( + # NuGet Packages API URL + [Parameter(Mandatory = $true)] + [String] + $PackagesURL, + + # Azure Artifacts user name + [Parameter(Mandatory = $true)] + [String] + $Username, + + # Azure Artifacts password + [Parameter(Mandatory = $true)] + [SecureString] + $Password, + + # View to promote into. This will be a Guid + [Parameter(Mandatory = $true)] + [String] + $ViewId, + + # Git ref (short) for the release tag ex: v1.3.5 + [Parameter(Mandatory = $true)] + $ReleaseRef + ) + + $package = "DataImport.Web" + $version = $ReleaseRef.substring(1) + + $body = ' + { + "data": { + "viewId": "' + $ViewId + '" + }, + "operation": 0, + "packages": [ + { + "id": "' + $package + '", + "version": "' + $version + '" + } + ] + }' + + $parameters = @{ + Method = "POST" + ContentType = "application/json" + Credential = New-Object -TypeName PSCredential -ArgumentList $Username, $Password + URI = $PackagesURL + Body = $body + } + + $parameters | Out-Host + $parameters.URI | Out-Host + $parameters.Body | Out-Host + + $response = Invoke-WebRequest @parameters -UseBasicParsing + $response | ConvertTo-Json -Depth 10 | Out-Host +} + +Export-ModuleMember -Function Invoke-Promote