SendHtml returns the number of sent messages in field msg.MigrateToCh… #47
This file contains hidden or 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: Dev build | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths-ignore: [ '.**', 'docs/**', '**.md' ] | |
| workflow_dispatch: | |
| env: | |
| PROJECT_PATH: src/Telegram.Bot/Telegram.Bot.csproj | |
| UNITTEST_PATH: test/Telegram.Bot.Tests.Unit/Telegram.Bot.Tests.Unit.csproj | |
| CONFIGURATION: Release | |
| PACKAGES_PATH: src/Telegram.Bot/bin/Release | |
| RELEASE_NOTES: ${{ github.event.head_commit.message }} | |
| jobs: | |
| build: | |
| permissions: | |
| id-token: write # enable GitHub OIDC token issuance for this job | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 30 | |
| - name: Determine version | |
| run: | | |
| git fetch --depth=30 --tags | |
| DESCR_TAG=$(git describe --tags) | |
| DESCR_TAG=${DESCR_TAG#v} | |
| COMMITS=${DESCR_TAG#*-} | |
| COMMITS=${COMMITS%-*} | |
| LAST_TAG=${DESCR_TAG%%-*} | |
| NEXT_VERSION=${LAST_TAG%.*}.$((${LAST_TAG##*.} + 1))-dev.$COMMITS | |
| RELEASE_VERSION=${{vars.RELEASE_VERSION}}-dev.$COMMITS | |
| if [[ "$RELEASE_VERSION" > "$NEXT_VERSION" ]] then VERSION=$RELEASE_VERSION; else VERSION=$NEXT_VERSION; fi | |
| echo Last tag: $LAST_TAG · Next version: $NEXT_VERSION · Release version: $RELEASE_VERSION · Build version: $VERSION | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| # - name: Setup .NET | |
| # uses: actions/setup-dotnet@v4 | |
| # with: | |
| # dotnet-version: 9.0.x | |
| # - name: Restore dependencies | |
| # run: dotnet restore | |
| - name: Build | |
| run: | | |
| RELEASE_NOTES=${RELEASE_NOTES//$'\n'/%0A} | |
| RELEASE_NOTES=${RELEASE_NOTES//\"/%22} | |
| RELEASE_NOTES=${RELEASE_NOTES//,/%2C} | |
| RELEASE_NOTES=${RELEASE_NOTES//;/%3B} | |
| dotnet build $PROJECT_PATH --configuration $CONFIGURATION -p:Version=$VERSION -p:ReleaseNotes="$RELEASE_NOTES" | |
| - name: Test | |
| run: dotnet test $UNITTEST_PATH --verbosity normal --configuration $CONFIGURATION | |
| # - name: Pack | |
| # run: dotnet pack $PROJECT_PATH --no-build --configuration $CONFIGURATION -p:Version=$VERSION -p:ReleaseNotes="$RELEASE_NOTES" | |
| # - name: Upload artifact | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: packages | |
| # path: $PACKAGES_PATH/*.nupkg | |
| - name: NuGet login (OIDC → temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Nuget push | |
| run: dotnet nuget push $PACKAGES_PATH/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json | |
| # run: dotnet nuget push $PACKAGES_PATH/*.nupkg --api-key ${{secrets.NUGETAPIKEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json | |
| - name: Deployment Notification | |
| env: | |
| JSON: | | |
| { | |
| "status": "success", "complete": true, "commitMessage": ${{ toJSON(env.RELEASE_NOTES) }}, | |
| "message": "{ \"commitId\": \"${{ github.sha }}\", \"buildNumber\": \"${{ env.VERSION }}\", \"repoName\": \"${{ github.repository }}\"}" | |
| } | |
| run: | | |
| curl -X POST -H "Content-Type: application/json" -d "$JSON" ${{ secrets.DEPLOYED_WEBHOOK }} |