diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 90fcfbe4..fc8b4119 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,15 +72,24 @@ 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. - ## VS Code Extension + ${{ env.CHANGELOG }} + + ## 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" \