Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,31 @@ jobs:
- 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
dotnet pack ForceOps -c release -r win-x64 /p:ContinuousIntegrationBuild=true
dotnet pack ForceOps -c release -r any -p:PublishAot=false /p:ContinuousIntegrationBuild=true

- name: Build (AOT)
# The .sha256 sidecar is used by the scoop bucket's autoupdate
# (https://github.com/domsleee/scoop-bucket).
- name: Create sha256 for release exe
run: |
dotnet publish -c release /p:UseAot=1 /p:ContinuousIntegrationBuild=true
cp -r ForceOps/bin ForceOps/bin_aot
dotnet clean
$exe = "ForceOps/bin/release/net10.0/win-x64/publish/ForceOps.exe"
(Get-FileHash $exe -Algorithm SHA256).Hash.ToLower() | Set-Content -NoNewline "$exe.sha256"

- name: Create release
if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)') }}
uses: softprops/action-gh-release@v2
with:
draft: true
name: "${{ steps.get_version.outputs.version }}"
files: ForceOps/bin_aot/Release/net10.0/win-x64/publish/ForceOps.exe
files: |
ForceOps/bin/release/net10.0/win-x64/publish/ForceOps.exe
ForceOps/bin/release/net10.0/win-x64/publish/ForceOps.exe.sha256
tag_name: "${{ steps.get_version.outputs.version }}"

# RID-specific packages must be on the feed before the top-level pointer
# package, so the pointer package is pushed in a second step.
- 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 ForceOps.Lib/nupkg_pack/ForceOps.Lib.${{ steps.get_version.outputs.version }}.snupkg --skip-duplicate
dotnet nuget push -k ${{ secrets.NUGET_AUTH_TOKEN }} -s https://api.nuget.org/v3/index.json ForceOps/nupkg/ForceOps.win-x64.${{ steps.get_version.outputs.version }}.nupkg ForceOps/nupkg/ForceOps.any.${{ steps.get_version.outputs.version }}.nupkg ForceOps.Lib/nupkg/ForceOps.Lib.${{ steps.get_version.outputs.version }}.nupkg ForceOps.Lib/nupkg/ForceOps.Lib.${{ steps.get_version.outputs.version }}.snupkg --skip-duplicate
dotnet nuget push -k ${{ secrets.NUGET_AUTH_TOKEN }} -s https://api.nuget.org/v3/index.json ForceOps/nupkg/ForceOps.${{ steps.get_version.outputs.version }}.nupkg --skip-duplicate
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace ForceOps.Benchmarks;

// [SimpleJob(RuntimeMoniker.NativeAot80)]
// [SimpleJob(RuntimeMoniker.NativeAot10_0)]
[SimpleJob]
public class FileAndDirectoryDeleterBenchmark
{
Expand Down
7 changes: 3 additions & 4 deletions ForceOps/ForceOps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
<PackageOutputPath>./nupkg</PackageOutputPath>
</PropertyGroup>

<PropertyGroup Condition="$(UseAot) != '1'">
<PropertyGroup>
<PackAsTool>true</PackAsTool>
<ToolCommandName>forceops</ToolCommandName>
</PropertyGroup>

<PropertyGroup Condition="'$(UseAot)' == '1'">
<!-- RID-specific tool packaging, see https://learn.microsoft.com/en-us/dotnet/core/tools/rid-specific-tools -->
<PublishAot>true</PublishAot>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ToolPackageRuntimeIdentifiers>win-x64;any</ToolPackageRuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ Uses [LockChecker](https://github.com/domsleee/LockCheck) to find processes lock
## Installation

### Install with [`scoop`](http://scoop.sh/) (recommended)
It has a faster startup because it uses [Native AOT](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/):
Installs the [Native AOT](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/) build and doesn't require the .NET SDK:

```shell
scoop install https://gist.github.com/domsleee/f765105f512ec607ee0a6e3ee5debd6d/raw/forceops.json
scoop bucket add domsleee https://github.com/domsleee/scoop-bucket
scoop install forceops
```

To update:
```shell
scoop update forceops --force
scoop update forceops
```

### Alternative - install with [`dotnet`](https://dotnet.microsoft.com/en-us/download)
Expand All @@ -29,6 +30,8 @@ scoop update forceops --force
dotnet tool install -g forceops
```

On x64 Windows this installs the same Native AOT build as the scoop install. Other architectures get a framework-dependent build. Requires the .NET 10 SDK or later to install.

To update:
```shell
dotnet tool update -g forceops
Expand Down
Loading