Skip to content

Commit

Permalink
👍 Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
AutumnSky1010 committed Dec 7, 2024
1 parent 37737c8 commit 5f5cd2d
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 28 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/deploy_doc.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'version'
required: true

jobs:
publish-to-nuget:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Build the SoundMaker project
run: dotnet build src/SoundMaker/SoundMaker.csproj --no-restore --warnaserror --configuration Release

- name: Publish to NuGet
run: dotnet nuget push "./src/SoundMaker/bin/Release/SoundMaker.*.nupkg" --api-key ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json

create-release:
needs: publish-to-nuget
runs-on: ubuntu-latest
steps:
- name: Create a tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
custom_tag: SoundMaker-Ver.${{ inputs.version }}
tag_prefix:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1.14.0
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}

deploy-docs:
needs: publish-to-nuget
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Install DocFX
run: dotnet tool install -g docfx

- name: Build Documentation
run: docfx docs/docfx.json

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site

0 comments on commit 5f5cd2d

Please sign in to comment.