forked from AElfProject/AElf
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.38 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
on:
push:
branches:
- preview
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- 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: Read version from version.props
run: |
version=$(grep -oP '<Version>\K[^<]+' common.props)
echo "VERSION=$version" >> $GITHUB_ENV
- name: Determine if preview version
run: |
if [[ "${GITHUB_REF}" == "refs/heads/preview" ]]; then
echo "IS_PREVIEW=true" >> $GITHUB_ENV
else
echo "IS_PREVIEW=false" >> $GITHUB_ENV
fi
- name: Build project
run: dotnet build --configuration Release /p:Version=$VERSION /p:Platform="Any CPU"
- name: Pack
run: dotnet pack AElf.All.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 }}