Update #226
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) RLIeberLieber Software GmbH | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
name: Publish Components | |
on: | |
push: | |
branches: | |
- main | |
env: | |
ModelName: DemoModel | |
ModelExtension: eapx | |
ReviewSessionURL: https://nexus.lieberlieber.com/repository/lemontree-component/ | |
#ComponentModelShortCut: C:\tools\Shortcuts\Shortcut_LL_TEST_COMPONENTS.eap | |
jobs: | |
PublishComponents: | |
defaults: | |
run: | |
shell: pwsh | |
runs-on: windows-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
fetch-depth: 0 | |
# download Lemontree.Automation on a runner and setup the license | |
- uses: LieberLieber/setup-LemonTree.Automation@v5 | |
id: GetLTA | |
with: | |
License: ${{secrets.LTALICENSE}} | |
#ExeLocation &"${{steps.GetLTA.outputs.LemonTreeAutomationExecutable}}" | |
- name: Publish LemonTree Components | |
run: | | |
&"${{steps.GetLTA.outputs.LemonTreeAutomationExecutable}}" publish --Model ${{env.ModelName}}.${{env.ModelExtension}} --PackageDirectory ".\\" --All | |
# doesn't work on public runner because it can not access the SQL Server Repository | |
#- name: Import LemonTree Components on MSSQL Repository | |
# run: | | |
# &"${{env.LemonTreeAutomationExecutable}}" import --Model ${{env.ComponentModelShortCut}} --Components "*.mpms" | |
- name: Archive Session Files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Model Components | |
path: "*.mpms" | |
retention-days: 5 | |
- name: Upload LemonTree Components to Nexus | |
run: | | |
$files = Get-ChildItem *.mpms | |
foreach ($file in $files) | |
{ | |
$sfName = $file.Name | |
$sfNameUri = [uri]::EscapeDataString($sfName) | |
$targetUrl = "${{env.ReviewSessionURL}}$sfNameUri" | |
Write-Output "Uploading $sfName to Nexus: $targetUrl" | |
while (Test-Path Alias:curl) {Remove-Item Alias:curl} #remove the alias binding from curl to Invoke-WebRequest | |
curl "-u${{secrets.NEXUSAUTHENTICATION}}" -T ".\$sfName" "$targetUrl" | |
} | |