Skip to content

Commit

Permalink
ci: 🔧 Ajustado workflow de release
Browse files Browse the repository at this point in the history
  • Loading branch information
LiloMarino committed Oct 26, 2024
1 parent 4f798f5 commit bd82dd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ jobs:

- name: Install dependencies
run: npm ci


- name: Create or update release branch
run: |
git checkout -B release
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release --branches main
run: npx semantic-release --branches release

- name: Create Pull Request to merge release into main
env:
Expand Down
8 changes: 3 additions & 5 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ 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');
},
};

export default {
branches: ['main', 'develop'],
branches: ['main', 'release'],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
Expand All @@ -27,9 +26,8 @@ export default {
'@semantic-release/changelog',
['@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]',
branch: 'release', // Especifica a branch de commit
}],
],
};

0 comments on commit bd82dd3

Please sign in to comment.