forked from AElfProject/AElf
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.63 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
on:
push:
branches:
- preview
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.*' # Change this to the .NET version you're using
- name: Install protoc
run: |
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip
unzip protoc-3.11.4-linux-x86_64.zip -d protoc3
sudo mv protoc3/bin/* /usr/local/bin/
sudo mv protoc3/include/* /usr/local/include/
- name: Install contract_plugin binary
run: |
bash scripts/download_binary.sh
- name: Read version from version.props
run: |
if [[ "${GITHUB_REF}" == "refs/heads/preview" ]]; then
version=$(grep -oP '<Version>\K[^<]+' common.props)
echo "VERSION=$version-preview.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
else
version=$(grep -oP '<Version>\K[^<]+' common.props)
echo "VERSION=$version" >> $GITHUB_ENV
fi
- name: Build project
run: dotnet build AElf.sln --configuration Release /p:Version=$VERSION /p:Platform="Any CPU"
- name: Pack
run: dotnet pack AElf.sln --configuration Release --output nupkgs /p:Version=$VERSION /p:Platform="Any CPU"
- name: Publish NuGet packages
uses: dansiegel/[email protected]
with:
filename: '**/*.nupkg'
apiKey: ${{ secrets.PREVIEW_NUGET_API_KEY }}
feedUrl: ${{ secrets.PREVIEW_NUGET_FEED_URL }}