Skip to content

Update publish.yml

Update publish.yml #10

Workflow file for this run

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: 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 }}