Skip to content

Commit

Permalink
Update Release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Brennan1994 authored Sep 10, 2024
1 parent 844b0d6 commit 3bc9cd8
Showing 1 changed file with 21 additions and 27 deletions.
48 changes: 21 additions & 27 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: Release

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

jobs:
Build:
runs-on: windows-latest
permissions:
contents: write
env:
Solution_Name: Fda.sln
runs-on: windows-latest

steps:
- name: Checkout
Expand All @@ -22,34 +19,31 @@ jobs:
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'

- name: Add Github and Nexus Source
run: |
dotnet nuget add source --username HydrologicEngineeringCenter --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/HydrologicEngineeringCenter/index.json"
dotnet nuget add source --name fda-nuget "https://www.hec.usace.army.mil/nexus/repository/fda-nuget/"
dotnet nuget add source --name dss "https://www.hec.usace.army.mil/nexus/repository/dss/"
- name: Install dependencies
run: dotnet restore -v quiet

- name: Build
run: dotnet build -v quiet --configuration Release --no-restore
- name: Create version number
shell: pwsh
run: |
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
$VERSION = $TAG -replace '^v', ''
echo "VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Publish
run: dotnet publish -c Release -v quiet --no-build HEC.FDA.View/HEC.FDA.View.csproj

- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: HEC-FDA-2.0-Snapshot
path: .\build\publish\fda2.0
run: dotnet publish -c Release -v quiet /p:Version=${{ env.VERSION }} HEC.FDA.View/HEC.FDA.View.csproj

- name: Zip
run: 7z a HEC-FDA.7z D:\a\HEC-FDA\HEC-FDA\Build\publish\FDA2.0\
- name: Zip Release Package
shell: pwsh
run: |
$root_path = Get-Location
Compress-Archive -Path "$root_path/HEC.FDA.View/bin/Any CPU/Release/net8.0/win-x64/" -DestinationPath "$root_path/HEC-FDA-${env:VERSION}.zip
- name: upload artifact to release
uses: shogo82148/actions-upload-release-asset@v1.6.2
- name: Release
uses: softprops/action-gh-release@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: HEC-FDA.7z
files: "**/*.zip"

0 comments on commit 3bc9cd8

Please sign in to comment.