Skip to content

Update publish-dotnet-binaries.yml #18

Update publish-dotnet-binaries.yml

Update publish-dotnet-binaries.yml #18

name: Publish .NET Core binaries
on:
push:
branches:
- main
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
publish:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get commit message
run: |
for (/f "delims=" %a) in ('git log -1 --pretty=format^:%s') do set COMMIT_MESSAGE=%a
setx COMMIT_MESSAGE "%COMMIT_MESSAGE%"
::COMMIT_MESSAGE=$(git log -1 --pretty=format:%s)
::echo "::set-env name=COMMIT_MESSAGE::$COMMIT_MESSAGE"
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: |
cd ./src/
dotnet restore
- name: Build binaries
run: |
cd ./src/
dotnet build --configuration Release
- name: Build win-x64
run: |
cd ./src
dotnet publish --configuration Release --self-contained --runtime win-x64 --verbosity quiet -p:PublishTrimmed=true -o ../build/win-x86
- name: Bundle win-x86
uses: vimtor/action-zip@v1
with:
files: ./build/win-x64
dest: JsUnMap-${{steps.tag.outputs.tag}}-win-x64.zip
recursive: false
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.BUILD_KEY }}
with:
tag_name: v${{ github.run_number }}
release_name: Release v${{ github.run_number }}
body: |
Auto release.
${{ env.COMMIT_MESSAGE }}
draft: false
prerelease: false
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: binaries
path: ./build/