Skip to content

fix: add initial changelog #3

fix: add initial changelog

fix: add initial changelog #3

on:
push:
branches:
- main
# See: https://github.com/google-github-actions/release-please-action
name: release-please
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
# Change type and name depending on your repository
# See: https://github.com/google-github-actions/release-please-action#release-types-supported
release-type: rust
package-name: evident
pull-request-title-pattern: "chore: release${component} ${version}"
# Breaking changes might happen frequently before 1.0.0 => only bump minor
bump-minor-pre-major: true
changelog-types: >
[
{"type":"feat","section":"Features","hidden":false},
{"type":"fix","section":"Bug Fixes","hidden":false},
{"type":"arch","section":"Architectur/Refactor","hidden":false},
{"type":"chore","section":"Miscellaneous","hidden":true}
]
release-report:
runs-on: ubuntu-latest
container:
image: manuelhatzl/mantra:main
needs: release-please
outputs:
report: ${{ steps.report.outputs.report }}
env:
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
release_created: ${{ needs.release-please.outputs.release_created }}
tag_name: ${{ needs.release-please.outputs.tag_name }}
steps:
- uses: actions/checkout@v3
if: ${{ env.release_created }}
with:
repository: 'mhatzl/evident-wiki'
path: './req_folder'
sparse-checkout: 5-Requirements
- name: report
id: report
if: ${{ env.release_created }}
run: |
mantra release --branch=$BRANCH_NAME --release-tag=${{ env.tag_name }} --wiki-url-prefix=https://github.com/mhatzl/evident/wiki --report-file=release_report.md ./req_folder
content=$(cat release_report.md)
content="${content//\'/\\\'}"
content="${content//\"/\\\"}"
echo "report<<EOF" >> $GITHUB_OUTPUT
echo "$content" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
upload-report:
runs-on: ubuntu-latest
needs: ["release-report", "release-please"]
env:
release_created: ${{ needs.release-please.outputs.release_created }}
tag_name: ${{ needs.release-please.outputs.tag_name }}
report: ${{ needs.release-report.outputs.report }}
steps:
- uses: actions/checkout@v3
if: ${{ env.release_created }}
- name: upload
if: ${{ env.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
report="$(echo '${{ env.report }}')"
echo "$report" >> release_report.md
cat release_report.md
gh release upload ${{ env.tag_name }} release_report.md