Skip to content

Update PR.yml

Update PR.yml #7

Workflow file for this run

name: Push
on:
push:
branches: [ develop ]
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
type: choice
options:
- info
- warning
- debug
permissions:
contents: read
jobs:
build:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Test
run: dotnet test VkNet.Tests/VkNet.Tests.csproj -c Release -f net7.0
- name: Create file status_job1.txt and write the job status into it
if: always()
run: |
echo ${{ job.status }} > status_job1.txt
- name: Upload file status_job1.txt as an artifact
if: always()
uses: actions/upload-artifact@v1
with:
name: pass_status_job1
path: status_job1.txt
nuget:
runs-on: ubuntu-latest
needs: build
if: needs.build.result == 'success'
steps:
- name: Build
run: dotnet build VkNet/VkNet.csproj --configuration Release
- name: Build the NuGet package
run: dotnet pack VkNet/VkNet.csproj --configuration Release --output ${{env.DOTNET_ROOT}}\Package
- name: Publish NuGet Package
run: dotnet nuget push ${{env.DOTNET_ROOT}}\Package\*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
telegram:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [build, nuget]
steps:
- name: Download artifact pass_status_job1
uses: actions/download-artifact@v1
with:
name: pass_status_job1
- name: Set the statuses of Job 1 as output parameters
id: set_outputs
run: |
echo "::set-output name=status_job1::$(<pass_status_job1/status_job1.txt)"
- id: string
uses: Panuchi/[email protected]
with:
string: ${{ steps.set_outputs.outputs.status_job1 }}
- name: Send Telegram notification
uses: appleboy/telegram-action@master
with:
to: '402295722'
token: '6347791580:AAHifoaYKSI3vDyRaF0deCeTcFFcEiTrz3s'
format: 'html'
disable_web_page_preview: true
message: |
<b>${{ steps.string.outputs.result }}</b>
<code>Reason: ${{ github.event_name }}
Build №: ${{ github.run_number }}</code>
<b>Build queued by: ${{ github.triggering_actor }}</b>
https://github.com/${{ github.repository }}/commit/${{github.sha}}