Fix output name (#50) #20
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: Build | |
on: | |
push: | |
tags: | |
- "v*" | |
# workflow_dispatch: | |
# inputs: | |
# version: | |
# description: "Version to create release for" | |
# required: true | |
# type: string | |
permissions: | |
contents: write | |
env: | |
CI: true | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
jobs: | |
build-cli: | |
name: Build CLI (${{ matrix.rid }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- rid: win-x64 | |
- rid: linux-x64 | |
- rid: osx-x64 | |
#- rid: linux-musl-x64 | |
#- rid: linux-arm64 | |
#- rid: win-arm64 | |
#- rid: osx-arm64 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
- name: Build BicepDocs | |
run: dotnet build --configuration release src/BicepDocs.sln | |
- name: Run tests | |
run: dotnet test --configuration release src/BicepDocs.sln | |
- id: get-version | |
run: | | |
parsedVersion=$(echo ${{ github.ref }} | cut -dv -f2) | |
echo "version=$parsedVersion" >> "$GITHUB_OUTPUT" | |
- name: Publish BicepDocs | |
run: dotnet publish --configuration release --self-contained true -p:AssemblyVersion=${{ steps.get-version.outputs.version }} -p:Version=${{ steps.get-version.outputs.version }} -p:PublishTrimmed=true -p:PublishSingleFile=true -p:TrimmerDefaultAction=copyused -p:SuppressTrimAnalysisWarnings=true -r ${{ matrix.rid }} ./src/BicepDocs.Cli/BicepDocs.Cli.csproj | |
- name: Rename binary | |
if: matrix.rid != 'win-x64' | |
run: mv ./src/BicepDocs.Cli/bin/release/net6.0/${{ matrix.rid }}/publish/bicepdocs ./src/BicepDocs.Cli/bin/release/net6.0/${{ matrix.rid }}/publish/bicepdocs-${{ matrix.rid }} | |
- name: Rename binary (win) | |
if: matrix.rid == 'win-x64' | |
run: mv ./src/BicepDocs.Cli/bin/release/net6.0/${{ matrix.rid }}/publish/bicepdocs.exe ./src/BicepDocs.Cli/bin/release/net6.0/${{ matrix.rid }}/publish/bicepdocs-${{ matrix.rid }}.exe | |
- name: Upload BicepDocs | |
if: matrix.rid != 'win-x64' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bicepdocs-${{ matrix.rid }} | |
path: ./src/BicepDocs.Cli/bin/release/net6.0/${{ matrix.rid }}/publish/bicepdocs-${{ matrix.rid }} | |
if-no-files-found: error | |
- name: Upload BicepDocs | |
if: matrix.rid == 'win-x64' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bicepdocs-${{ matrix.rid }} | |
path: ./src/BicepDocs.Cli/bin/release/net6.0/${{ matrix.rid }}/publish/bicepdocs-${{ matrix.rid }}.exe | |
if-no-files-found: error | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: build-cli | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
path: ./binaries | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: ./binaries | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: false | |
prerelease: false | |
fail_on_unmatched_files: true | |
generate_release_notes: true | |
files: ./binaries/**/* | |
# tag_name: ${{ github.event.inputs.version }} |