diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef3a36e..7ac2802 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - + with: + ssh-key: ${{ secrets.DEPLOY_KEY }} # Usando a chave SSH de deploy + - name: Set up Node.js uses: actions/setup-node@v4 with: @@ -19,17 +21,8 @@ jobs: - name: Install dependencies run: npm ci - - - name: Run semantic-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - npx semantic-release --branches main - - name: Create Pull Request to merge release into main + - name: Run semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ - -d '{"title":"Release Update","body":"Merging release branch into main.","head":"release","base":"main"}' \ - https://api.github.com/repos/${{ github.repository }}/pulls + run: npx semantic-release diff --git a/release.config.js b/release.config.js index 4b9f1b6..ce2a989 100644 --- a/release.config.js +++ b/release.config.js @@ -9,7 +9,6 @@ const generatePatchNotes = { date: new Date().toISOString(), }; - // Grava o arquivo JSON na pasta public console.log('Gerando patch notes...'); writeFileSync('public/patch-notes.json', JSON.stringify(patchNotes, null, 2)); console.log('Patch notes gerados com sucesso em public/patch-notes.json'); @@ -17,19 +16,22 @@ const generatePatchNotes = { }; export default { - branches: ['main', 'develop'], + branches: ['main'], plugins: [ '@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', ['@semantic-release/npm', { npmPublish: false }], '@semantic-release/github', generatePatchNotes, - '@semantic-release/changelog', + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md" + } + ], ['@semantic-release/git', { assets: ['CHANGELOG.md', 'package.json', 'public/patch-notes.json'], - message: 'chore(release): :bookmark: Update changelog and patch notes', - // Aqui vocĂȘ especifica a branch onde deseja que os commits ocorram - branch: 'release' + message: 'chore(release): :bookmark: Update changelog and patch notes [skip ci]', }], ], };