diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..bbd19cc --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -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/setup-dotnet@v1.7.2 + with: + dotnet-version: 6.0.x + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + + - 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 }} +