Pre-Alpha Publish CLI #11
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: Pre-Alpha Publish CLI | |
on: | |
workflow_dispatch: | |
env: | |
PROJECT_NAME: NationsConverterCLI | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build | |
env: | |
ZIP_SUFFIX: .zip | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Add nuget.gbx.tools source | |
run: dotnet nuget add source https://nuget.gbx.tools/v3/index.json --name nuget.gbx.tools | |
- name: Publish | |
run: dotnet publish Src/${{ env.PROJECT_NAME }} | |
-c Release | |
-r win-x64 | |
-o build/${{ env.PROJECT_NAME }} | |
-p:PublishTrimmed=true | |
-p:PublishSingleFile=true | |
-p:EnableCompressionInSingleFile=true | |
--self-contained | |
- name: Zip to ${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }} | |
uses: thedoctor0/zip-release@main | |
with: | |
directory: build | |
path: ${{ env.PROJECT_NAME }} | |
filename: ../${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }} | |
- name: Calculate SHA256 (Linux) | |
run: | | |
sha256sum "${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }}" | awk '{print $1}' | tee >(cat) > ${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }}.hash.txt | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ env.PROJECT_NAME }}${{ env.ZIP_SUFFIX }} | |
if-no-files-found: error |