Update dotnet_pull_request.yml #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
package: | |
#runs-on: ubuntu-18.04 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '2.1.x' | |
- name: Change Version in Files | |
run: | | |
set -e | |
version_new="2.1."$((43+${{github.run_number}})) | |
version=$(cat VERSION) | |
sed -i -e 's/'$version'/'$version_new'/g' Iyzipay/IyzipayConstants.cs Iyzipay/Iyzipay.csproj VERSION | |
echo "ver=$version_new" >> $GITHUB_ENV | |
- name: Git Tasks | |
run: | | |
set -e | |
git config user.name "iyzico-ci" | |
git config user.email [email protected] | |
git add . | |
git commit -m "Automatic commit by iyzico-ci v${{env.ver}}" | |
git push origin master | |
git tag -a v${{env.ver}} -m "Automatic tag by iyzico-ci v${{env.ver}}" | |
git push origin v${{env.ver}} | |
- name: Github Release | |
run: | | |
echo "Creating GitHub release..." | |
create_asset_json=$( curl -# -XPOST -H "Authorization: token ${{secrets.TOKEN_GITHUB}}" -H "Content-Type: application/json" -H "Accept:application/json" --data-binary '{"tag_name": "v${{env.ver}}","target_commitish": "master","name": "iyzipay-dotnet ${{env.ver}}","body": "version ${{env.ver}}","draft": false,"prerelease": false}' https://api.github.com/repos/iyzico/iyzipay-dotnet/releases ) | |
echo $create_asset_json | |
echo "GitHub release created!" | |
- name: Package | |
run: dotnet pack -c Release Iyzipay | |
- name: Publish package to nuget | |
run: dotnet nuget push Iyzipay/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} |