diff --git a/.github/workflows/DFe.NET_build.yml b/.github/workflows/DFe.NET_build.yml index d5130006a..1f63b6a04 100644 --- a/.github/workflows/DFe.NET_build.yml +++ b/.github/workflows/DFe.NET_build.yml @@ -89,6 +89,20 @@ jobs: if: github.event_name == 'push' || github.event.inputs.nugetdeploy == 'true' runs-on: ${{ 'ubuntu-latest' }} steps: + - name: Criar Deployment + id: create_deployment + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + -d '{ + "ref": "${{ github.ref }}", + "environment": "NuGet", + "description": "Deploy de pacotes para o NuGet", + "required_contexts": [] + }' \ + https://api.github.com/repos/${{ github.repository }}/deployments + - name: Download Artifacts uses: actions/download-artifact@v4 with: @@ -145,3 +159,17 @@ jobs: uses: Ilshidur/action-discord@master with: args: 'Lançado Zeus DFe.NET versão {{ DISCORD_MENSAGEM }} no Nuget! Acesse: https://www.nuget.org/profiles/ZeusAutomacao' + + - name: Atualizar Status do Deployment + if: success() + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + -d '{ + "state": "success", + "environment": "NuGet", + "description": "Deploy concluído com sucesso.", + "log_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + }' \ + https://api.github.com/repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.id }}/statuses \ No newline at end of file