Skip to content

Commit

Permalink
Create dotnet.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jim60105 committed Feb 21, 2022
1 parent fcba7fe commit 58e53b3
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: dotnet package

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- v*

jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core SDK 6.0.x
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Install dependencies
run: dotnet restore --nologo

- name: Build
run: msbuild YoutubeSegmentDownloader.sln -t:publish -p:Configuration=Release -p:DeployOnBuild=true -p:PublishProfile=ClickOnceProfile

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: artifact
path: bin/Release/net6.0-windows/win-x64/app.publish
retention-days: 1

deploy_setup:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: artifact

- name: Deploy files to setup branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./
keep_files: true
publish_branch: setup

release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: artifact

- name: Release single file
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_DELETE: false
GHR_REPLACE: true
GHR_PATH: YoutubeSegmentDownloader.exe
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release setup file
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_DELETE: false
GHR_REPLACE: true
GHR_PATH: setup.exe
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 58e53b3

Please sign in to comment.