Skip to content

Commit

Permalink
Fixed release note logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rdelfin committed Mar 31, 2024
1 parent 5866ad1 commit bd0fc3a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/release_notes.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# {version}

This crate provides a set of functions to facilitate compiling flatbuffers to Rust from within
Rust. This is particularly helpful for use in `build.rs` scripts. Please note that for
compatiblity this crate will only support a single version of the `flatc` compiler. Please
check what version that is against whatever version is installed on your system.That said, due
to flatbuffers' versioning policy, it could be ok to mix patch and even minor versions.

Please read our [`README`](https://github.com/rdelfin/flatbuffers-build/blob/main/README.md) or
our [Rust docs](https://docs.rs/flatbuffers-build/latest/flatbuffers-build/) for more details on
how to use this crate.

Changelog:

24 changes: 20 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
version: ${{ steps.check_version.outputs.version }}
tag: ${{ steps.check_version.outputs.tag }}
commit: ${{ steps.check_version.outputs.commit }}
previous_version: ${{ steps.bump_version.outputs.previous_version }}
steps:
- uses: actions/checkout@v3
- run: |
Expand All @@ -64,7 +65,11 @@ jobs:
echo "PWD: ${PWD}" && ls && pip3 install -r requirements.txt
- name: Bump appropriate version
run: python3 new_version.py ${{ inputs.bumpLevel }}
id: bump_version
run: |
PREVIOUS_VERSION=$(tq -f Cargo.toml .package.version | sed 's/^.\(.*\).$/\1/')
echo "previous_version=${PREVIOUS_VERSION}" >> $GITHUB_OUTPUT
python3 new_version.py ${{ inputs.bumpLevel }}
- name: Show diff
run: git diff
Expand Down Expand Up @@ -93,7 +98,8 @@ jobs:
- name: Commit version
run: |
git commit -am "${{ inputs.bumpLevel }} version bump"
VERSION=$(tq -f Cargo.toml .package.version | sed 's/^.\(.*\).$/\1/')
git commit -am "release version ${VERSION}"
- name: Push new version
run: |
Expand Down Expand Up @@ -124,11 +130,21 @@ jobs:
with:
ref: ${{ needs.bump_version.outputs.commit }}

- name: Generate changelog
id: github_changelog
uses: mikepenz/release-changelog-builder-action@v4
outputFile: ${{ github.workspace }}/.github/changelog.txt
fromTag: v${{ needs.bump_version.outputs.previous_version }}
toTag: ${{ needs.bump_version.outputs.commit }}
env:
GITHUB_TOKEN: ${{ secretes.GITHUB_TOKEN }}

- name: Generate release notes
run: |
# Generate the release notes
sed 's/{version}/${{ env.VERSION }}/g' ${{ github.workspace }}/.github/release_notes.template \
> ${{ github.workspace }}/.github/release_notes.txt
cat ${{ github.workspace }}/.github/release_notes.template ${{ github.workspace }}/.github/changelog.txt \
| sed 's/{version}/${{ env.VERSION }}/g' \
> ${{ github.workspace }}/.github/release_notes.txt
env:
VERSION: ${{ needs.bump_version.outputs.version }}

Expand Down

0 comments on commit bd0fc3a

Please sign in to comment.