docs: fix broken docs links #144
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Changesets | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build binaries | |
| run: bun run build | |
| - name: Create Release Pull Request or Build | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: bun run version | |
| publish: bun run release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get version from package.json | |
| if: steps.changesets.outputs.hasChangesets == 'false' | |
| id: version | |
| run: echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT | |
| - name: Extract changelog for version | |
| if: steps.changesets.outputs.hasChangesets == 'false' | |
| id: changelog | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| # Extract changelog section for this version | |
| # Match from "## X.Y.Z" until the next "## " heading or end of file | |
| CHANGELOG=$(awk -v ver="$VERSION" ' | |
| BEGIN { found=0; output="" } | |
| /^## / { | |
| if (found) exit | |
| if ($2 == ver) { found=1; next } | |
| } | |
| found { output = output $0 "\n" } | |
| END { print output } | |
| ' CHANGELOG.md) | |
| # Trim trailing whitespace | |
| CHANGELOG=$(echo "$CHANGELOG" | sed -e 's/[[:space:]]*$//') | |
| echo "notes<<EOF" >> $GITHUB_OUTPUT | |
| echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| if: steps.changesets.outputs.hasChangesets == 'false' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.version }} | |
| name: ${{ steps.version.outputs.version }} | |
| body: ${{ steps.changelog.outputs.notes }} | |
| files: | | |
| dist/ralph-darwin-arm64 | |
| dist/ralph-darwin-x64 | |
| dist/ralph-linux-arm64 | |
| dist/ralph-linux-x64 |