Skip to content

Commit

Permalink
Create Publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
azhuge233 committed Jun 21, 2023
1 parent b5eadaf commit 7375c34
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish

on:
workflow_dispatch:
push:
branches: [ master ]
paths-ignore:
- '**/**.md'
- '.github/**'

jobs:
publish:
name: Publish the app
runs-on: windows-latest
permissions:
contents: write

steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Publish
shell: pwsh
run: |
Set-Location "$env:GITHUB_WORKSPACE"
dotnet restore
dotnet publish -c Release -r linux-x64 -p:PublishDir="$env:GITHUB_WORKSPACE\Release\linux-x64" --sc
dotnet publish -c Release -r win-x64 -p:PublishDir="$env:GITHUB_WORKSPACE\Release\win-x64" --sc
dotnet publish -c Release -r osx-x64 -p:PublishDir="$env:GITHUB_WORKSPACE\Release\osx-x64" --sc
Compress-Archive -Path "$env:GITHUB_WORKSPACE\Release\win-x64\" -DestinationPath "CW-win-x64.zip"
Compress-Archive -Path "$env:GITHUB_WORKSPACE\Release\linux-x64\" -DestinationPath "CW-linux-x64.zip"
Compress-Archive -Path "$env:GITHUB_WORKSPACE\Release\osx-x64\" -DestinationPath "CW-osx-x64.zip"
- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
files: ./*.zip

0 comments on commit 7375c34

Please sign in to comment.