Build and Release #9
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: Build and Package | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
env: | |
GITHUB_ACTIONS: true | |
PUBLISH_DIR: ConvertApi.Cli/bin/Release/net8.0/win-x64/publish | |
OUTPUT_DIR: output | |
steps: | |
# Checkout the code | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Setup .NET SDK | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.x' | |
# Run tests | |
# - name: Test | |
# run: dotnet test ConvertApi.Cli.Tests | |
# Build the project | |
- name: Build | |
run: dotnet publish ConvertApi.Cli/ConvertApi.Cli.csproj -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true | |
# Create a zip package | |
# - name: Create ZIP package | |
# run: | | |
# mkdir -p ${{ env.OUTPUT_DIR }} | |
# zip -j ${{ env.OUTPUT_DIR }}/convertApi-cli.zip ${{ env.PUBLISH_DIR }}/* | |
# Upload the artifact | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: convertApi-cli | |
path: ${{ env.PUBLISH_DIR }} | |
retention-days: 1 |