Update Release.yml #24
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
Build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v3.2.0 | |
with: | |
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: 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 /p:Version=${{ env.VERSION }} HEC.FDA.View/HEC.FDA.View.csproj | |
- 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: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: "**/*.zip" |