Skip to content

Commit

Permalink
Merge branch 'main' into Geospatial
Browse files Browse the repository at this point in the history
  • Loading branch information
Brennan1994 authored Sep 11, 2024
2 parents dda182b + b93b7ef commit 9d2c744
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Integration

on:
pull_request:
Expand All @@ -24,6 +24,9 @@ jobs:
uses: actions/[email protected]
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Add Nexus Source
run: dotnet nuget add source --name fda-nuget "https://www.hec.usace.army.mil/nexus/repository/fda-nuget/"

- name: Install dependencies
run: dotnet restore -v quiet
Expand Down
71 changes: 34 additions & 37 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Publish NuGet Packages

on:
release:
types: [published]
push:
tags:
- "v*.*.*"

env:
Project_Name: Consequences/Consequences.csproj
Expand All @@ -25,30 +26,32 @@ jobs:
run: |
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
$VERSION = $TAG -replace '^v', ''
echo "VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
- name: Add Nexus Source
run: dotnet nuget add source --name fda-nuget "https://www.hec.usace.army.mil/nexus/repository/fda-nuget/"

- name: Build for Windows x64
run: dotnet publish ${{ env.PROJECT_NAME }} -c Release -r win-x64 --self-contained -p:PublishAot=true /p:PackageVersion=${{ env.VERSION }}
run: dotnet publish ${{ env.PROJECT_NAME }} -c Release -r win-x64 --self-contained -p:PublishAot=true /p:Version=${{ env.VERSION }}

- name: Pack NuGet packages
run: dotnet pack ${{ env.PROJECT_NAME }} -c Release /p:PackageVersion=${{ env.VERSION }}
run: dotnet pack ${{ env.PROJECT_NAME }} -c Release /p:PackageVersion=${{ env.VERSION }}

- name: Publish NuGet packages to GitHub Packages
run: dotnet nuget push **/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate

- name: Zip Release Package
shell: pwsh
run: |
$SOURCE_PATH ="${pwd}/Consequences/bin/Release/net8.0/win-x64/native/*"
$DEST_PATH = "${pwd}/USACE.HEC.Consequences-${{env.VERSION}}-windows-x64.zip"
Compress-Archive -Path $SOURCE_PATH -DestinationPath $DEST_PATH
echo "PACKAGE=$DEST_PATH" >> $env:GITHUB_ENV
- name: Upload Windows build artifact
uses: actions/upload-artifact@v4
with:
name: USACE.HEC.Consequences-${{ env.VERSION }}-windows-x64
path: ./Consequences/bin/Release/net8.0/win-x64/native/

- name: upload artifact to release
uses: actions/[email protected]
- name: Release
uses: softprops/action-gh-release@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./Consequences/bin/Release/net8.0/win-x64/native/USACE.HEC.Consequences-${{ env.VERSION }}-windows-x64.zip
asset_name: USACE.HEC.Consequences-${{ env.VERSION }}-windows-x64
asset_content_type: application/zip
files: ${{ env.PACKAGE }}

build-linux:
runs-on: ubuntu-latest
Expand All @@ -70,25 +73,19 @@ jobs:
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Build for Linux x64
run: dotnet publish ${{ env.PROJECT_NAME }} -c Release -r linux-x64 --self-contained -p:PublishAot=true /p:PackageVersion=${{ env.VERSION }}

- name: Pack NuGet packages
run: dotnet pack ${{ env.PROJECT_NAME }} -c Release /p:PackageVersion=${{ env.VERSION }}
run: dotnet publish ${{ env.PROJECT_NAME }} -c Release -r linux-x64 --self-contained -p:PublishAot=true /p:Version=${{ env.VERSION }}

- name: Publish NuGet packages to GitHub Packages
run: dotnet nuget push **/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate

- name: Upload Linux build artifact
uses: actions/upload-artifact@v4
with:
name: USACE.HEC.Consequences-${{ env.VERSION }}-linux-x64
path: ./Consequences/bin/Release/net8.0/linux-x64/native/

- name: upload artifact to release
uses: actions/[email protected]
- name: Zip Release Package
shell: bash
run: |
SRC_PATH="./Consequences/bin/Release/net8.0/linux-x64/native/"
PKG_NAME="USACE.HEC.Consequences-${{ env.VERSION }}-linux-x64.zip"
cd $SRC_PATH
zip -r $PKG_NAME ./
FULL_PKG="${SRC_PATH}${PKG_NAME}"
echo "FULL_PKG=${FULL_PKG}" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./Consequences/bin/Release/net8.0/linux-x64/native/USACE.HEC.Consequences-${{ env.VERSION }}-linux-x64.zip
asset_name: USACE.HEC.Consequences-${{ env.VERSION }}-linux-x64
asset_content_type: application/zip

files: ${{ env.FULL_PKG }}
2 changes: 1 addition & 1 deletion Consequences.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D661B25B-F61F-48AA-B626-09DDFC8FB7E6}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.github\workflows\CI.yml = .github\workflows\CI.yml
.github\workflows\Release.yml = .github\workflows\Release.yml
.github\workflows\Integration.yml = .github\workflows\Integration.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsequencesTest", "ConsequencesTest\ConsequencesTest.csproj", "{95BCC49B-7780-41E9-8365-C51B5E1B3D5E}"
Expand Down

0 comments on commit 9d2c744

Please sign in to comment.