Skip to content

Commit

Permalink
Merge pull request #2044 from moreal/ci/gh-actions/store-lib9c-states…
Browse files Browse the repository at this point in the history
…ervice-build-result
  • Loading branch information
moreal authored Aug 1, 2023
2 parents 63ca3c9 + 2d7ea65 commit 24b8d39
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .Lib9c.StateService/Lib9c.StateService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\.Libplanet.Extensions.RemoteBlockChainStates\Libplanet.Extensions.RemoteBlockChainStates.csproj" />
<ProjectReference Include="..\.Libplanet.Extensions.ActionEvaluatorCommonComponents\Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration ${{ matrix.configuration }}
run: dotnet build --self-contained=false --no-restore --configuration ${{ matrix.configuration }}
- name: Test
run: dotnet test --no-restore --verbosity normal --configuration ${{ matrix.configuration }}

Expand All @@ -69,7 +69,7 @@ jobs:
sed -i -E 's|\[MaybeNullWhen\(false\)] out TValue value|out TValue value|' Lib9c/TableData/Sheet.cs
sed -i -E 's|public bool TryGetValue\(TKey key, out TValue value, bool throwException\)|public bool TryGetValue\(TKey key, out TValue? value, bool throwException\)|' Lib9c/TableData/Sheet.cs
- name: build
run: dotnet build
run: dotnet build --self-contained=false

release:
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,26 @@ jobs:
fi
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
s3-lib9c-stateservice:
strategy:
matrix:
runtime: ["osx-arm64", "linux-arm64", "linux-x64", "win-x64"]
name: Publish Lib9c.StateService (${{ matrix.runtime }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.400
- name: Publish Lib9c.StateService
run: dotnet publish ./.Lib9c.StateService/Lib9c.StateService.csproj -o out -r ${{ matrix.runtime }}
- name: Compress the build result
run: zip -r ../${{ matrix.runtime }}.zip .
working-directory: ./out
- name: Upload S3
run: aws s3 cp ${{ matrix.runtime }}.zip s3://9c-dx/lib9c-stateservices/${{ github.sha }}/
with:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

0 comments on commit 24b8d39

Please sign in to comment.