-
Notifications
You must be signed in to change notification settings - Fork 48
67 lines (65 loc) · 2.04 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: publish
on:
push:
branches:
- development
- main
jobs:
nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.400
- name: build
run: |
dotnet_args="-c Release -p:NoPackageAnalysis=true"
if [[ ! "$GITHUB_REF" =~ ^refs/tags/* ]]; then
project_suffix=dev.${{ github.sha }}
dotnet_args="$dotnet_args --version-suffix $project_suffix"
fi
# shellcheck disable=SC2086
dotnet build $dotnet_args
# shellcheck disable=SC2086
dotnet pack $dotnet_args
- name: push
if: github.event_name != 'pull_request'
run: |
if [[ "$NUGET_API_KEY" != "" ]]; then
for project in Lib9c Lib9c.Abstractions
do
dotnet nuget push ./$project/.bin/Lib9c.*.nupkg \
--api-key "$NUGET_API_KEY" \
--skip-duplicate \
--source https://api.nuget.org/v3/index.json
done
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 }}/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-2"