mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-24 03:56:30 +00:00
230c2d9457
* Setup executable installer * Increment update to 0.9.3 * Improve installer
101 lines
3.0 KiB
YAML
101 lines
3.0 KiB
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT license.
|
|
|
|
# This continuous integration pipeline is triggered anytime a user pushes code to the repo.
|
|
# This pipeline builds the Wpf project, runs unit tests, then saves the MSIX build artifact.
|
|
name: Daybreak CD Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
matrix:
|
|
targetplatform: [x64]
|
|
|
|
runs-on: windows-latest
|
|
|
|
env:
|
|
Configuration: Release
|
|
Solution_Path: Daybreak.sln
|
|
Test_Project_Path: Daybreak.Tests\Daybreak.Tests.csproj
|
|
Wpf_Project_Path: Daybreak\Daybreal.csproj
|
|
Actions_Allow_Unsecure_Commands: true
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get Latest Tag
|
|
id: getLatestTag
|
|
uses: WyriHaximus/github-action-get-previous-tag@v1
|
|
|
|
- name: Generate changelog
|
|
id: gen_changelog
|
|
run: |
|
|
$changeLog = git log --no-merges --pretty="%h - %s (%an)<br />" ${{ env.LatestReleaseTag }}..HEAD
|
|
echo "::set-env name=Changelog::$changeLog"
|
|
env:
|
|
LatestReleaseTag: ${{steps.getLatestTag.outputs.tag}}
|
|
|
|
- name: Print changelog
|
|
run: |
|
|
echo "${{ env.Changelog }}"
|
|
|
|
- name: Install .NET Core
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: '6.x'
|
|
|
|
- name: Setup MSBuild.exe
|
|
uses: microsoft/setup-msbuild@v1.0.1
|
|
|
|
- name: Restore project
|
|
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier
|
|
env:
|
|
RuntimeIdentifier: win-${{ matrix.targetplatform }}
|
|
|
|
- name: Build Daybreak project
|
|
run: dotnet build Daybreak -c $env:Configuration
|
|
|
|
- name: Set version variable
|
|
run: |
|
|
$version = .\Scripts\GetBuildVersion.ps1
|
|
echo "::set-env name=Version::$version"
|
|
|
|
- name: Create publish launcher files
|
|
run: dotnet publish .\Daybreak\Daybreak.csproj -c $env:Configuration -r $env:RuntimeIdentifier -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true -o .\Publish
|
|
env:
|
|
RuntimeIdentifier: win-${{ matrix.targetplatform }}
|
|
|
|
- name: Create publish installer files
|
|
run: dotnet publish .\Daybreak.Installer\Daybreak.Installer.csproj -c $env:Configuration -r $env:RuntimeIdentifier -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true -o .\Publish
|
|
env:
|
|
RuntimeIdentifier: win-${{ matrix.targetplatform }}
|
|
|
|
- name: Pack publish files
|
|
run: |
|
|
Write-Host $env
|
|
.\Scripts\BuildRelease.ps1 -version $env:Version
|
|
shell: pwsh
|
|
|
|
- name: Publish release
|
|
uses: Xotl/cool-github-releases@v1.1.2
|
|
with:
|
|
mode: update
|
|
tag_name: v${{ env.Version }}
|
|
release_name: Daybreak v${{ env.Version }}
|
|
assets: .\Publish\daybreakv${{ env.Version }}.zip
|
|
github_token: ${{ env.GITHUB_TOKEN }}
|
|
replace_assets: true
|
|
body_mrkdwn: ${{ env.Changelog }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|