Skip to content

docs: Updated README with custom ROBOCORP_HOME + mermaid graph #14

docs: Updated README with custom ROBOCORP_HOME + mermaid graph

docs: Updated README with custom ROBOCORP_HOME + mermaid graph #14

Workflow file for this run

name: Create Release with Changelog
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Extract changelog for the tag
id: changelog
run: |
# Get the current tag
CURRENT_TAG=${GITHUB_REF#refs/tags/}
# Extract changelog for the current tag using awk
CHANGELOG=$(grep -A 1000 "^## \[$CURRENT_TAG\]" CHANGELOG.md | sed -n '/^## \[v0.2.0\]/,/^<a name/{p}' | sed '$d')
# Handle no match (e.g., if the tag isn't in the changelog)
if [[ -z "$CHANGELOG" ]]; then
echo "Changelog for ${CURRENT_TAG} not found. Please ensure CHANGELOG.md is updated."
exit 1
fi
echo "CHANGELOG_CONTENT<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
echo "${{ env.CHANGELOG_CONTENT }}" > temp_changelog.md
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="Release ${tag#v}" \
--notes-file=temp_changelog.md