-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: CI | ||
name: Integration | ||
|
||
on: | ||
pull_request: | ||
|
@@ -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 | ||
|
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
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 | ||
|
@@ -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 | ||
|
@@ -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 }} |
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