-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
461 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: ci | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "**" | ||
paths: | ||
- ".github/workflows/ci.yml" | ||
- "src/**" | ||
- "*.sln" | ||
- "*.props" | ||
tags: | ||
- "v*" | ||
|
||
pull_request: | ||
branches: | ||
- "**" | ||
paths: | ||
- ".github/workflows/ci.yml" | ||
- "src/**" | ||
- "*.sln" | ||
- "*.props" | ||
|
||
jobs: | ||
meta: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- id: meta | ||
run: | | ||
is_release=${{ startsWith(github.ref, 'refs/tags/v') }} | ||
tag=$(git describe --tags --match "v*" ${{ github.ref }} || true) | ||
if [[ $tag != v* ]]; then | ||
tag=$(date "+v0.0.0-%y%m%d-$(git rev-parse --short HEAD)") | ||
fi | ||
if ! $($is_release) ; then | ||
prefix=${tag%-*-*} | ||
suffix=${tag#$prefix-} | ||
next=${prefix##*.} | ||
((++next)) | ||
prefix=${prefix%.*} | ||
tag="$prefix.$next-Preview.$suffix" | ||
fi | ||
echo tag=$tag | tee -a $GITHUB_OUTPUT | ||
echo version=${tag#v} | tee -a $GITHUB_OUTPUT | ||
echo is_release=$is_release | tee -a $GITHUB_OUTPUT | ||
outputs: | ||
tag: ${{ steps.meta.outputs.tag }} | ||
version: ${{ steps.meta.outputs.version }} | ||
is_release: ${{ steps.meta.outputs.is_release }} | ||
|
||
publish: | ||
needs: [meta] | ||
strategy: | ||
matrix: | ||
project: [MBA.Cli] | ||
os: [win, linux, osx] | ||
arch: [x64, arm64] | ||
suffix: [-single-cut] | ||
dotnet: [ '7.0' ] | ||
fail-fast: false | ||
env: | ||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||
PUBLISH_NAME: ${{ matrix.project }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.suffix }}-${{ needs.meta.outputs.tag }} | ||
PUBLISH_PATH: ./Publish #./Publish/${{ matrix.project }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.suffix }}/ | ||
CSPROJ_PATH: ./src/${{ matrix.project }}/${{ matrix.project }}.csproj | ||
PUBXML_PATH: ./src/${{ matrix.project }}/Properties/PublishProfiles/${{ matrix.os }}-${{ matrix.arch }}${{ matrix.suffix }}.pubxml | ||
|
||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet }} | ||
cache: true | ||
cache-dependency-path: '**/packages.lock.json' | ||
- run: dotnet restore --locked-mode | ||
|
||
- run: dotnet publish ${{ env.CSPROJ_PATH }} --no-restore -p:Version=${{ needs.meta.outputs.version }} -p:PublishProfile=${{ env.PUBXML_PATH }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: ${{ env.PUBLISH_NAME }} | ||
path: ${{ env.PUBLISH_PATH }} | ||
|
||
- name: Pack | ||
if: ${{ needs.meta.outputs.is_release == 'true' }} | ||
working-directory: ${{ env.PUBLISH_PATH }} | ||
run: 7z a -r ../${{ env.PUBLISH_NAME }}.zip ./* | ||
|
||
- uses: softprops/action-gh-release@v1 | ||
if: ${{ needs.meta.outputs.is_release == 'true' }} | ||
with: | ||
body_path: CHANGELOG.md | ||
prerelease: true | ||
files: ${{ env.PUBLISH_NAME }}.zip | ||
tag_name: ${{ needs.meta.outputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageVersion Include="Maa.AgentBinary" Version="1.0.0" /> | ||
<PackageVersion Include="Maa.Framework.Runtimes" Version="0.3.7" /> | ||
<PackageVersion Include="Maa.ToolKit.Extensions" Version="0.6.0-beta.1.1" /> | ||
<PackageVersion Include="Serilog" Version="3.0.1" /> | ||
<PackageVersion Include="Serilog.Sinks.Debug" Version="2.0.0" /> | ||
<PackageVersion Include="Serilog.Sinks.Console" Version="4.1.0" /> | ||
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" /> | ||
</ItemGroup> | ||
</Project> | ||
<PropertyGroup> | ||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageVersion Include="Maa.AgentBinary" Version="1.0.0" /> | ||
<PackageVersion Include="Maa.Framework.Runtimes" Version="0.3.7" /> | ||
<PackageVersion Include="Maa.ToolKit.Extensions" Version="0.3.7.2" /> | ||
<PackageVersion Include="Serilog" Version="3.0.1" /> | ||
<PackageVersion Include="Serilog.Sinks.Debug" Version="2.0.0" /> | ||
<PackageVersion Include="Serilog.Sinks.Console" Version="4.1.0" /> | ||
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/MBA.Cli/Properties/PublishProfiles/linux-arm64-single-cut.pubxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project> | ||
<PropertyGroup> | ||
<Platform>ARM64</Platform> | ||
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier> | ||
<PublishDir>..\..\Publish\MBA.Cli-linux-arm64-single-cut\</PublishDir> | ||
|
||
<Configuration>Release</Configuration> | ||
<SelfContained>true</SelfContained> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
</PropertyGroup> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
src/MBA.Cli/Properties/PublishProfiles/linux-x64-single-cut.pubxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project> | ||
<PropertyGroup> | ||
<Platform>x64</Platform> | ||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier> | ||
<PublishDir>..\..\Publish\MBA.Cli-linux-x64-single-cut\</PublishDir> | ||
|
||
<Configuration>Release</Configuration> | ||
<SelfContained>true</SelfContained> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
</PropertyGroup> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
src/MBA.Cli/Properties/PublishProfiles/osx-arm64-single-cut.pubxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project> | ||
<PropertyGroup> | ||
<Platform>ARM64</Platform> | ||
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier> | ||
<PublishDir>..\..\Publish\MBA.Cli-osx-arm64-single-cut\</PublishDir> | ||
|
||
<Configuration>Release</Configuration> | ||
<SelfContained>true</SelfContained> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
</PropertyGroup> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
src/MBA.Cli/Properties/PublishProfiles/osx-x64-single-cut.pubxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project> | ||
<PropertyGroup> | ||
<Platform>x64</Platform> | ||
<RuntimeIdentifier>osx-x64</RuntimeIdentifier> | ||
<PublishDir>..\..\Publish\MBA.Cli-osx-x64-single-cut\</PublishDir> | ||
|
||
<Configuration>Release</Configuration> | ||
<SelfContained>true</SelfContained> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
</PropertyGroup> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
src/MBA.Cli/Properties/PublishProfiles/win-arm64-single-cut.pubxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project> | ||
<PropertyGroup> | ||
<Platform>ARM64</Platform> | ||
<RuntimeIdentifier>win-arm64</RuntimeIdentifier> | ||
<PublishDir>..\..\Publish\MBA.Cli-win-arm64-single-cut\</PublishDir> | ||
|
||
<Configuration>Release</Configuration> | ||
<SelfContained>true</SelfContained> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
</PropertyGroup> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
src/MBA.Cli/Properties/PublishProfiles/win-x64-single-cut.pubxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project> | ||
<PropertyGroup> | ||
<Platform>x64</Platform> | ||
<RuntimeIdentifier>win-x64</RuntimeIdentifier> | ||
<PublishDir>..\..\Publish\MBA.Cli-win-x64-single-cut\</PublishDir> | ||
|
||
<Configuration>Release</Configuration> | ||
<SelfContained>true</SelfContained> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
</PropertyGroup> | ||
</Project> |
Oops, something went wrong.