Skip to content

Commit

Permalink
Merge pull request #7 from PepperDash/hotfix/3series-build
Browse files Browse the repository at this point in the history
  • Loading branch information
ngenovese11 authored Nov 18, 2024
2 parents a9238d4 + b47fc1d commit 90ffdfc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/essentialsplugins-3Series-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

# Build the solutions in the docker image
- name: Get SLN Path
shell: powershell
Expand All @@ -102,27 +103,30 @@ jobs:
$solution_path = $solution_path -replace "(?:[^\\]*\\){4}", ""
Write-Output $solution_path
echo "SOLUTION_PATH=$($solution_path)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Set the SOLUTION_FILE
- name: Get SLN File
shell: powershell
run: |
$solution_file = Get-ChildItem .\*.3Series.sln -recurse -Path "$($Env:GITHUB_WORKSPACE)"
echo "SOLUTION_FILE=$($solution_file.BaseName)"| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build Solution
shell: powershell
run: |
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_PATH)"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
# Zip up the output files as needed
- name: Zip Build Output
shell: powershell
run: |
$destination = "$($Env:GITHUB_HOME)\output"
$destination = "$($Env:GITHUB_WORKSPACE)\output"
New-Item -ItemType Directory -Force -Path ($destination)
Get-ChildItem ($destination)
$exclusions = @("packages", "4-series")
$exclusions = "packages"
# Trying to get any .json schema files (not currently working)
# Gets any files with the listed extensions.
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.nuspec" | ForEach-Object {
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)\src" -include "*.clz", "*.cpz", "*.cplz", "*.nuspec", "*.md" | ForEach-Object {
$allowed = $true;
# Exclude any files in submodules
foreach ($exclude in $exclusions) {
Expand All @@ -145,13 +149,16 @@ jobs:
Write-Host $filenames
if ($filenames.length -gt 0) {
# Attempt to get the files and return them to the output directory
Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) -Force
Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)\src" -include $filenames | Copy-Item -Destination ($destination) -Force
}
}
Get-ChildItem -Path $destination\*.cplz | Rename-Item -NewName { "$($_.BaseName)-$($Env:VERSION)$($_.Extension)" }
Get-ChildItem -Path $destination\*.cplz | Rename-Item -NewName { "$($_.BaseName)-$($Env:VERSION)$($_.Extension)" } | Write-Host
Get-ChildItem -Path $destination
- name: Remove Existing Nuspec Files
run: |
Get-ChildItem -Path .\ -Filter *.nuspec -Recurse | Remove-Item -Force
- name: Create Nuspec File
shell: powershell
run: |
Expand All @@ -163,6 +170,12 @@ jobs:
$title = (Get-Culture).TextInfo.ToTitleCase($makeModel)
$makeModel = $title -replace ' ', '' # Removing spaces for the ID
$id = "PepperDash.Essentials.Plugin." + $makeModel
echo "Repo: $repoFullName"
echo "Repo Name: $repoName"
echo "Make/Model: $makeModel"
echo "Title: $title"
echo "ID: $id"
echo "Owner: ${{ github.repository_owner }}"
$nuspecContent = @"
<?xml version='1.0' encoding='utf-8'?>
<package>
Expand All @@ -189,19 +202,22 @@ jobs:
</package>
"@
echo $nuspecContent > ${{ github.workspace }}\project.nuspec
- name: Get nuget File
shell: powershell
run: |
$nuspec_file = (Get-ChildItem *.nuspec -recurse).BaseName
echo "NUSPEC_FILE=$($nuspec_file)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Pulls the nuget builder packages
- name: Add nuget.exe
if: ${{ !contains( env.NUSPEC_FILE, 'EssentialsPluginTemplate' ) }}
uses: nuget/setup-nuget@v2
# Creating nuget Packages

# Creating nuget Packages
- name: Add Github Packages source
if: ${{ !contains( env.NUSPEC_FILE, 'EssentialsPluginTemplate' ) }}
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
run: nuget sources add -name github -source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}

- name: Create nuget package
if: ${{ !contains( env.NUSPEC_FILE, 'EssentialsPluginTemplate' ) }}
Expand All @@ -219,17 +235,19 @@ jobs:
- name: Publish nuget package to nuget.org
if: github.repository_owner == 'PepperDash' && github.repository_visibility == 'public' && !contains(env.NUSPEC_FILE, 'EssentialsPluginTemplate')
run: nuget push *.nupkg -Source https://api.nuget.org/v3/index.json
# Create the release on the source repo

# Create the release on the source repo
- name: Get release notes
uses: actions/download-artifact@v4
with:
name: change-log

- name: Upload Release
id: create_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: 'output\*.*(cplz|dll|xml)'
artifacts: output\*.*(cplz|dll|xml)
prerelease: ${{ inputs.channel != '' }}
tag: ${{ inputs.tag }}
commit: ${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/essentialsplugins-4Series-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
bodyFile: ./CHANGELOG.md
- name: Setup Nuget
run: |
nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username pepperdash -password ${{ secrets.GITHUB_TOKEN }}
nuget sources add -name github -source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -username pepperdash -password ${{ secrets.GITHUB_TOKEN }}
nuget setApiKey ${{ secrets.GITHUB_TOKEN }} -Source github
nuget setApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json
- name: Publish to Nuget
Expand Down

0 comments on commit 90ffdfc

Please sign in to comment.