updarted workflow for version number #110
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: | |
env: | |
DOTNET_VERSION: "7.x.x" # The .NET SDK version to use | |
SOLUTION_DIR: "VisualPairCoding" | |
PROJECT: "./VisualPairCoding.AvaloniaUI/VisualPairCoding.AvaloniaUI.csproj" | |
RELEASEPREFIX: "VisualPairCoding" | |
jobs: | |
build: | |
name: build-${{matrix.os}} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macOS-latest] | |
include: | |
- os: macos-latest | |
RUNTIMEID: osx-x64 | |
OUTPUTDIR: VisualPairCoding-osx-x64 | |
- os: windows-latest | |
RUNTIMEID: win-x64 | |
OUTPUTDIR: VisualPairCoding-win-x64 | |
- os: ubuntu-latest | |
RUNTIMEID: linux-x64 | |
OUTPUTDIR: VisualPairCoding-linux-x64 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Install dependencies | |
run: dotnet restore | |
working-directory: Source/${{ env.SOLUTION_DIR }} | |
- name: Set version number | |
run: ./Set-Version-Number.ps1 "${{github.ref}}" | |
working-directory: Scripts | |
shell: pwsh | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
working-directory: Source/${{ env.SOLUTION_DIR }} | |
- name: Test + Cover | |
run: dotnet test | |
working-directory: Source/${{ env.SOLUTION_DIR }} | |
- name: Publish | |
run: dotnet publish ${{ env.PROJECT }} -c Release -o ${{matrix.OUTPUTDIR}} -p:PublishReadyToRun=true --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:UseAppHost=true -r ${{matrix.RUNTIMEID}} | |
working-directory: Source/${{ env.SOLUTION_DIR }} | |
- uses: vimtor/action-zip@v1 | |
with: | |
files: ./Source/${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}/ | |
dest: ${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
${{ env.SOLUTION_DIR }}/${{matrix.OUTPUTDIR}}.zip |