Skip to content

Improve test reliability and fix workstation domain trust issue #156

Improve test reliability and fix workstation domain trust issue

Improve test reliability and fix workstation domain trust issue #156

Workflow file for this run

name: release
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
release:
name: ${{ matrix.target }}
permissions:
contents: write
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version
id: get_version
uses: KageKirin/get-csproj-version@v1.0.0
with:
file: Directory.Build.props
- name: Print Current Version
run: |
echo Current Version: ${{ steps.get_version.outputs.version }}
- name: Install Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Directory structure
run: |
ls
- name: Dotnet Installation Info
run: dotnet --info
- name: Pack
run: |
dotnet pack -c release /p:ContinuousIntegrationBuild=true
cp -r ForceOps/nupkg ForceOps/nupkg_pack
cp -r ForceOps.Lib/nupkg ForceOps.Lib/nupkg_pack
dotnet clean
- name: Build (AOT)
run: |
dotnet publish -c release /p:UseAot=1 /p:ContinuousIntegrationBuild=true
cp -r ForceOps/bin ForceOps/bin_aot
dotnet clean
- name: Create release
if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)') }}
uses: softprops/action-gh-release@v1
with:
draft: true
name: "${{ steps.get_version.outputs.version }}"
files: ForceOps/bin_aot/Release/net8.0/win-x64/publish/ForceOps.exe
tag_name: "${{ steps.get_version.outputs.version }}"
- name: Publish NuGet
if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)') }}
run: |
dotnet nuget push -k ${{ secrets.NUGET_AUTH_TOKEN }} -s https://api.nuget.org/v3/index.json ForceOps/nupkg_pack/ForceOps.${{ steps.get_version.outputs.version }}.nupkg ForceOps.Lib/nupkg_pack/ForceOps.Lib.${{ steps.get_version.outputs.version }}.nupkg --skip-duplicate