Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: extract changelog for GitHub release notes #92

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install toolchain
uses: moonrepo/setup-rust@v0
- name: Build main binary
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -141,8 +139,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install wasm-pack
uses: jetli/[email protected]
Expand Down Expand Up @@ -210,6 +206,9 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Extract changelog
run: |
bash scripts/print-changelog.sh ${{ needs.build.outputs.version }} >| ${{ github.workspace }}/RELEASE_NOTES
- name: Create GitHub release and tag
uses: softprops/action-gh-release@v1
env:
Expand All @@ -219,6 +218,7 @@ jobs:
tag_name: cli/v${{ needs.build.outputs.version }}
draft: false
prerelease: ${{ needs.build.outputs.prerelease == 'true' }}
body_path: ${{ github.workspace }}/RELEASE_NOTES
files: |
biome-*
fail_on_unmatched_files: true
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release_js_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -154,6 +152,9 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Extract changelog
run: |
bash scripts/print-changelog.sh ${{ needs.build.outputs.version }} >| ${{ github.workspace }}/RELEASE_NOTES
- name: Create GitHub release and tag
uses: softprops/action-gh-release@v1
env:
Expand All @@ -163,4 +164,5 @@ jobs:
tag_name: js-api/v${{ needs.build.outputs.version }}
draft: false
prerelease: ${{ needs.build.outputs.prerelease == 'true' }}
body_path: ${{ github.workspace }}/RELEASE_NOTES
generate_release_notes: true
Conaclos marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 4 additions & 2 deletions .github/workflows/release_lsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install toolchain
uses: moonrepo/setup-rust@v0
Expand Down Expand Up @@ -228,6 +226,9 @@ jobs:
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}

- name: Extract changelog
run: |
bash scripts/print-changelog.sh ${{ needs.build.outputs.version }} >| ${{ github.workspace }}/RELEASE_NOTES
- name: Create GitHub release and tag
uses: softprops/action-gh-release@v1
env:
Expand All @@ -237,6 +238,7 @@ jobs:
tag_name: lsp/v${{ needs.build.outputs.version }}
draft: false
prerelease: ${{ needs.build.outputs.prerelease == 'true' }}
body_path: ${{ github.workspace }}/RELEASE_NOTES
files: |
biome_lsp-*.vsix
fail_on_unmatched_files: true
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/website_deploy_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ jobs:
runs-on: ubuntu-latest
environment: Website deployment
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/website_deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ jobs:
runs-on: ubuntu-latest
environment: Website deployment
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand Down
14 changes: 14 additions & 0 deletions scripts/print-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -eu

# Print a changelog section (default: `Unreleased`).

VERSION="Unreleased"

if test -n "${1:-}" && grep -Eq "^## $1($| )" CHANGELOG.md; then
# The specified version has a dedicated section in the changelog
VERSION="$1"
fi

# print Changelog of $VERSION
awk -v version="$VERSION" '/^## / { if (p) { exit }; if ($2 == version) { p=1; next} } p' CHANGELOG.md