From e152efa094e5f8aca82cda5004f7a3c96f810951 Mon Sep 17 00:00:00 2001 From: i582 <51853996+i582@users.noreply.github.com> Date: Sat, 22 Feb 2025 17:17:30 +0400 Subject: [PATCH 1/2] feat(ci): add changelog to nightly builds Fixes #317 --- .github/workflows/nightly-release.yml | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 90fcfbe4..c9b59022 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for changelog generation - name: Enable Corepack run: corepack enable @@ -37,6 +39,26 @@ jobs: - name: Package Extension run: yarn package + - name: Generate Changelog + id: changelog + run: | + # Get the latest 0.x.0 release tag + LAST_MAJOR=$(git tag -l "v0.*" | grep -E "v0\.[0-9]+\.0$" | sort -V | tail -n1) + if [ -z "$LAST_MAJOR" ]; then + # If no major release found, use all commits + LAST_MAJOR=$(git rev-list --max-parents=0 HEAD) + fi + + # Generate changelog from commits + echo "CHANGELOG<> $GITHUB_ENV + echo "## What's Changed (since $LAST_MAJOR)" >> $GITHUB_ENV + echo "" >> $GITHUB_ENV + git log "$LAST_MAJOR..HEAD" --pretty=format:"* %s (%h)" >> $GITHUB_ENV + echo "" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Language Server Archive run: | VERSION=$(node -p "require('./package.json').version") @@ -50,11 +72,18 @@ jobs: run: | VERSION=$(node -p "require('./package.json').version") + # Delete both release and tag gh release delete nightly --yes || true + git push origin :refs/tags/nightly || true # Delete remote tag + git tag -d nightly || true # Delete local tag + + # Create new release with tag gh release create nightly \ --title "Nightly Build v${VERSION}" \ --notes "🌙 This is an automated nightly build from the master branch. + ${{ env.CHANGELOG }} + ## VS Code Extension - Download the .vsix file and install it through VS Code From fb1fc520c2692d1de626e6a4591701bdec6b9df9 Mon Sep 17 00:00:00 2001 From: i582 <51853996+i582@users.noreply.github.com> Date: Sat, 22 Feb 2025 17:20:21 +0400 Subject: [PATCH 2/2] fix --- .github/workflows/nightly-release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index c9b59022..fc8b4119 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -84,10 +84,12 @@ jobs: ${{ env.CHANGELOG }} - ## VS Code Extension + ## Installation + + ### VS Code Extension - Download the .vsix file and install it through VS Code - ## Other Editors + ### Other Editors - Download tact-language-server-v${VERSION}.tar.gz (Linux/macOS) or tact-language-server-v${VERSION}.zip (Windows) - Extract it to a convenient location - Configure your editor to use the language server from the extracted folder" \