|
| 1 | +name: 'Changelog Build (Release)' |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + last-release-tag: |
| 7 | + description: Last Git tag to start from (exclusive) (e.g. `v2.0.0`) |
| 8 | + type: string |
| 9 | + required: true |
| 10 | + release-branch: |
| 11 | + description: Release branch to build changelog on (e.g. `r2.1.0`) |
| 12 | + type: string |
| 13 | + required: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + changelog: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout branch |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + ref: main |
| 23 | + fetch-depth: 0 |
| 24 | + |
| 25 | + - name: Build Changelog |
| 26 | + id: github_tag |
| 27 | + |
| 28 | + env: |
| 29 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + with: |
| 31 | + # Configuration file is setup with filters for domains |
| 32 | + # owner:repo must point to current repo |
| 33 | + # fromTag: Auto resolved from historical tag order (previous tag compared to current tag) |
| 34 | + # toTag: Current tag reference |
| 35 | + configuration: ".github/workflows/config/changelog-config.json" |
| 36 | + owner: "NVIDIA" |
| 37 | + repo: "NeMo" |
| 38 | + ignorePreReleases: "false" |
| 39 | + failOnError: "false" |
| 40 | + fromTag: ${{ inputs.last-release-tag }} |
| 41 | + toTag: ${{ inputs.release-branch }} |
| 42 | + |
| 43 | + - name: Update changelog file |
| 44 | + env: |
| 45 | + RELEASE_BRANCH: ${{ inputs.release-branch }} |
| 46 | + CHANGELOG: ${{ steps.github_tag.outputs.changelog }} |
| 47 | + shell: bash -x -e -u -o pipefail {0} |
| 48 | + run: | |
| 49 | + RELEASE_VERSION=${RELEASE_BRANCH#r} |
| 50 | + CHANGELOG=$(echo "$CHANGELOG" | sed '/^[[:blank:]]*#/s/#/###/') |
| 51 | +
|
| 52 | + RELEASE_NOTES="## NVIDIA Neural Modules $RELEASE_VERSION |
| 53 | +
|
| 54 | + ### Detailed Changelogs: |
| 55 | +
|
| 56 | + $CHANGELOG" |
| 57 | +
|
| 58 | + printf "%s\n" "$RELEASE_NOTES" | sed '/<!-- Next changelog -->/r /dev/stdin' CHANGELOG.md > CHANGELOG.tmp.md |
| 59 | +
|
| 60 | + mv CHANGELOG.tmp.md CHANGELOG.md |
| 61 | +
|
| 62 | + - name: Inspect new changelog file |
| 63 | + run: cat CHANGELOG.md |
| 64 | + |
| 65 | + - name: Create Pull Request |
| 66 | + uses: peter-evans/create-pull-request@v7 |
| 67 | + with: |
| 68 | + commit-message: "beep boop: Update changelog" |
| 69 | + title: "Update changelog for `${{ inputs.release-branch }}`" |
| 70 | + signoff: true |
| 71 | + sign-commits: true |
| 72 | + base: main |
| 73 | + branch: bot/chore/update-changelog-into-${{ inputs.release-branch }} |
0 commit comments