Skip to content

Commit

Permalink
fix release creation in CI CD
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed Mar 20, 2024
1 parent cf26274 commit 886cbb7
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git tag -a v${{ needs.check_if_version_upgraded.outputs.to_version }} -m "Deployment tag for v${{ needs.check_if_version_upgraded.outputs.to_version }}"
git push --tags
git push --tags
docker:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -128,16 +128,16 @@ jobs:
- trigger_production_deploy
- check_if_version_upgraded
- create_tag
# We create a release only when all of the above are validated:
# - we are on default branch
# - version has been upgraded
# - we push to production
if: |
needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' &&
(
github.event_name == 'push' ||
needs.check_if_version_upgraded.outputs.is_release_beta == 'true'
)
# We create a release only when all of the above are validated:
# - we are on default branch
# - version has been upgraded
# - we push to production
env:
TO_VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }}
steps:
Expand All @@ -159,18 +159,14 @@ jobs:
const releaseNotes = await github.request(`POST /repos/${{ github.repository }}/releases/generate-notes`, {
tag_name: `v${{ env.TO_VERSION }}`,
previous_tag_name: `${{steps.get-latest-release-tag.outputs.result}}` })
return releaseNotes.data
core.setOutput("name", releaseNotes.data.name);
core.setOutput("body", releaseNotes.data.body);
- name: Create release notes on github
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const tag = `v${{ env.TO_VERSION }}`;
console.log('name : ', `${{fromJson(needs.generate-release-notes.outputs.release-notes).name}}`)
console.log('body : ', `${{fromJson(needs.generate-release-notes.outputs.release-notes).body}}`)
console.log('tag : ', tag )
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: `v${{ env.TO_VERSION }}`,
name: `${{fromJson(needs.generate-release-notes.outputs.release-notes).name}}`,
body: `${{fromJson(needs.generate-release-notes.outputs.release-notes).body}}`})
name: `${{ steps.generate-release-notes.outputs.name }}`,
body: `${{ steps.generate-release-notes.outputs.body }}`})

0 comments on commit 886cbb7

Please sign in to comment.