Skip to content

Commit

Permalink
Try to fix some error with Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
louanfontenele committed Dec 29, 2024
1 parent 5917b7f commit bdf215f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@ no-labels-template: "- $TITLE (commit: [`$SHORT_SHA`](https://github.com/${{ git
template: |
## What's Changed
$CHANGES
## 📦 Full Changelog
repository: `${{ github.repository }}`
previousTag: `${{ github.event.workflow_run.outputs.previous_tag | default: 'N/A' }}`
currentTag: `${{ github.event.workflow_run.outputs.current_tag | default: 'N/A' }}`
[Compare Changes](https://github.com/${{ github.repository }}/compare/${{ github.event.workflow_run.outputs.previous_tag | default: 'N/A' }}...${{ github.event.workflow_run.outputs.current_tag | default: 'N/A' }})
19 changes: 13 additions & 6 deletions .github/workflows/release-windows-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
workflow_dispatch: # Permite execução manual
workflow_dispatch:

jobs:
release:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Pega todas as tags existentes
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v3
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
if [ -z "$LATEST_TAG" ]; then
NEW_TAG="${GAME_VERSION}-1.0"
echo "No previous tag found. Creating initial tag: $NEW_TAG"
echo "Creating initial tag: $NEW_TAG"
git tag -a $NEW_TAG -m "Initial Release $NEW_TAG"
git push origin $NEW_TAG
else
Expand All @@ -63,22 +63,29 @@ jobs:
echo "::set-output name=previous_tag::$LATEST_TAG"
echo "::set-output name=current_tag::$NEW_TAG"
- name: Generate Changelog
run: |
echo "## What's Changed" > changelog.md
echo "" >> changelog.md
git log --pretty=format:"- %s by @%an" $LATEST_TAG..HEAD >> changelog.md
echo "" >> changelog.md
echo "## 📦 Full Changelog" >> changelog.md
echo "[Compare Changes](https://github.com/${{ github.repository }}/compare/$LATEST_TAG...$NEW_TAG)" >> changelog.md
- name: Draft Release
id: draft_release
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PREVIOUS_TAG: ${{ steps.tag.outputs.previous_tag }}
CURRENT_TAG: ${{ steps.tag.outputs.current_tag }}

- name: Publish Release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.current_tag }}
name: "Release ${{ env.current_tag }}"
body: ${{ steps.draft_release.outputs.body }}
body_path: ./changelog.md
artifacts: "release.zip"
draft: false
prerelease: false

0 comments on commit bdf215f

Please sign in to comment.