Skip to content

Commit

Permalink
Merge pull request #1565 from ZeusAutomacao/correcao_release
Browse files Browse the repository at this point in the history
Adiciona criação de tag e release automática no pipeline do GitHub Actions
  • Loading branch information
MauricioSuporte authored Nov 21, 2024
2 parents 2ee3f05 + 426fa2b commit d2fdc69
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/DFe.NET_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
#- name: Test
# run: dotnet test --no-build --verbosity normal

- name: Pack
run: |
dotnet pack -o ${{ github.workspace }} -v minimal -c Release -p:NuspecProperties=version=${{ steps.date.outputs.date }} -p:PackageVersion=${{ steps.date.outputs.date }} NuGet\Zeus.Net.NFe.NFCe\Zeus.Net.NFe.NFCe.csproj
Expand Down Expand Up @@ -107,12 +107,41 @@ jobs:
run: dotnet nuget push *.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.NUGET_SECRET_DEPLOY}}


- name: Criar Tag
id: create_tag
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag": "${{ needs.build.outputs.version }}",
"message": "Release versão ${{ needs.build.outputs.version }}",
"object": "${{ github.sha }}",
"type": "commit"
}' \
https://api.github.com/repos/${{ github.repository }}/git/tags
- name: Criar Release
id: create_release
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ needs.build.outputs.version }}",
"name": "${{ needs.build.outputs.version }}",
"body": "Esta é a release da versão ${{ needs.build.outputs.version }} do Zeus DFe.NET.\n\n### Links dos pacotes no NuGet:\n- [Zeus.NFe.NFCe](https://www.nuget.org/packages/Zeus.Net.NFe.NFCe/${{ needs.build.outputs.version }})\n- [Zeus.MDFe](https://www.nuget.org/packages/Zeus.Net.MDFe/${{ needs.build.outputs.version }})\n- [Zeus.CTe](https://www.nuget.org/packages/Zeus.Net.CTe/${{ needs.build.outputs.version }})",
"draft": false,
"prerelease": false
}' \
https://api.github.com/repos/${{ github.repository }}/releases
- name: Discord notification
continue-on-error: true
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_MENSAGEM: ${{ needs.build.outputs.version }}
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'
args: 'Lançado Zeus DFe.NET versão {{ DISCORD_MENSAGEM }} no Nuget! Acesse: https://www.nuget.org/profiles/ZeusAutomacao'

0 comments on commit d2fdc69

Please sign in to comment.