Skip to content
Open
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
39 changes: 39 additions & 0 deletions .github/workflows/publish-aelf-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
branches:
- release/aelf.tools/*

jobs:
publish:
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: aelf.tools
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.*' # Change this to the .NET version you're using

- name: Read version from Version.props
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
version=$(grep -oP '<Version>\K[^<]+' Version.props)
echo "VERSION=$version-rc.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV

- name: Build project
working-directory: ${{ env.WORKING_DIRECTORY }}
run: dotnet build --configuration Release /p:Version=$VERSION /p:Platform="Any CPU"

- name: Pack
working-directory: ${{ env.WORKING_DIRECTORY }}
run: dotnet pack --configuration Release --output nupkgs /p:Version=$VERSION /p:Platform="Any CPU"

- name: Publish NuGet packages
uses: dansiegel/publish-nuget@v1.2
with:
filename: '**/*.nupkg'
apiKey: ${{ secrets.PREVIEW_NUGET_API_KEY }}
feedUrl: ${{ secrets.PREVIEW_NUGET_FEED_URL }}
1 change: 1 addition & 0 deletions aelf.tools/AElf.Tools/AElf.Tools.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\Version.props" />
<PropertyGroup>
<AssemblyName>AElf.Tools</AssemblyName>
<VersionPrefix>$(AElfToolsVersion)</VersionPrefix>
Expand Down
18 changes: 18 additions & 0 deletions aelf.tools/AElf.Tools/build/AElf.Tools.targets
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@
<OutputDir>$(ObjPath)Protobuf/reference</OutputDir>
</Protobuf>

<!-- Add the proto files in custom. -->
<Protobuf Include="@(PbBase)">
<ContractOutputOptions>nocontract</ContractOutputOptions>
</Protobuf>
<Protobuf Include="@(PbContract)"/>
<Protobuf Include="@(PbMessage)">
<ContractOutputOptions>nocontract</ContractOutputOptions>
</Protobuf>
<Protobuf Include="@(PbReference)">
<ContractOutputOptions>reference</ContractOutputOptions>
<Access>Internal</Access>
</Protobuf>
<Protobuf Include="@(PbStub)">
<ContractOutputOptions>stub</ContractOutputOptions>
<Access>Internal</Access>
</Protobuf>

<!-- Add the proto files in the convention directory to the compile list. -->
<Protobuf Include="Protobuf/base/*.proto">
<ContractOutputOptions>nocontract</ContractOutputOptions>
</Protobuf>
Expand Down
5 changes: 5 additions & 0 deletions aelf.tools/Version.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.0.4</Version>
</PropertyGroup>
</Project>