Skip to content

Commit

Permalink
chore: Add action files
Browse files Browse the repository at this point in the history
  • Loading branch information
Yushu2606 committed May 16, 2024
1 parent 55ee1e2 commit 786b6ab
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
- push
- pull_request
- workflow_dispatch

env:
BUILD_TYPE: Release
DOTNET_VERSION: 8
ASSEMBLY_NAME: Hosihikari.PluginManager

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/[email protected]

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}.0.x

- name: Build
run: dotnet publish -c ${{ env.BUILD_TYPE }}

- name: Upload Artifact
uses: actions/[email protected]
with:
name: ${{ env.ASSEMBLY_NAME }}.${{ github.sha }}
path: src/bin
58 changes: 58 additions & 0 deletions .github/workflows/release-levi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release LeviLamina ver

on:
release:
types:
- published

env:
BUILD_TYPE: Release
DOTNET_VERSION: 8
ASSEMBLY_NAME: Hosihikari.PluginManager

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/[email protected]

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}.0.x

- name: Build
run: dotnet publish -c ${{ env.BUILD_TYPE }}

- name: Upload Artifact
uses: actions/[email protected]
with:
name: ${{ env.ASSEMBLY_NAME }}.Publish
path: src/bin/Release/net${{env.DOTNET_VERSION}}.0/publish/

upload-to-release:
needs:
- build
permissions:
contents: write
runs-on: macos-latest
steps:
- uses: actions/[email protected]

- uses: actions/[email protected]
with:
name: ${{ env.ASSEMBLY_NAME }}.Publish
path: artifact

- run: |
cp LICENSE.md artifact/
- run: |
zip -r ../hosihikari.pluginmanager.win-x64.zip *
working-directory: artifact
- uses: softprops/action-gh-release@v1
with:
files: |
hosihikari.pluginmanager.win-x64.zip
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
- workflow_dispatch

env:
BUILD_TYPE: Release
DOTNET_VERSION: 8
ASSEMBLY_NAME: Hosihikari.PluginManager

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/[email protected]

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}.0.x

- name: Build
run: dotnet publish -c ${{ env.BUILD_TYPE }}

- name: Publish NuGet
uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: src/${{ env.ASSEMBLY_NAME }}.csproj
VERSION_FILE_PATH: Directory.Build.props
TAG_COMMIT: false
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}
NO_BUILD: true

- name: Upload Artifact
uses: actions/[email protected]
with:
name: ${{ env.ASSEMBLY_NAME }}.Publish
path: src/bin/Release/net${{env.DOTNET_VERSION}}.0/publish/

0 comments on commit 786b6ab

Please sign in to comment.