Release v0.29.2 #68
Workflow file for this run
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: Release | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
# Validate that the tag matches VERSION file | |
validate: | |
name: Validate release | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate version consistency | |
run: | | |
VERSION="$(cat ./VERSION | tr -d '[:space:]')" | |
TAG_VERSION="${GITHUB_REF_NAME#v}" | |
if [[ "$VERSION" != "$TAG_VERSION" ]]; then | |
echo "❌ VERSION file ($VERSION) does not match tag ($TAG_VERSION)" | |
exit 1 | |
fi | |
echo "✅ Version validation passed: $VERSION" | |
# Build the release artifacts | |
build: | |
name: Build release artifacts | |
runs-on: ubuntu-22.04 | |
needs: validate | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
is_prerelease: ${{ steps.version.outputs.is_prerelease }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract version info | |
id: version | |
run: | | |
VERSION="$(cat ./VERSION | tr -d '[:space:]')" | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
if [[ "$VERSION" == *"-rc."* ]]; then | |
echo "is_prerelease=true" >> $GITHUB_OUTPUT | |
else | |
echo "is_prerelease=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Set up BEAM | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: 1.18.x | |
otp-version: 27.x | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
_build | |
deps | |
key: release-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
release- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Build release | |
run: | | |
mix elixir_ls.release2 -o ./release | |
zip -jr elixir-ls-v${{ steps.version.outputs.version }}.zip ./release | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: elixir-ls-${{ steps.version.outputs.version }} | |
path: elixir-ls-v${{ steps.version.outputs.version }}.zip | |
retention-days: 30 | |
# Create GitHub release | |
release: | |
name: Create GitHub release | |
runs-on: ubuntu-22.04 | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Needed for changelog generation | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: elixir-ls-${{ needs.build.outputs.version }} | |
- name: Extract changelog for this version | |
id: changelog | |
run: | | |
VERSION="${{ needs.build.outputs.version }}" | |
# Extract changelog section for this version | |
if grep -q "### v$VERSION:" CHANGELOG.md; then | |
# Get the section for this version | |
CHANGELOG_SECTION=$(awk "/### v$VERSION:/,/### v[0-9]/{if(/### v[0-9]/ && !/### v$VERSION:/) exit; print}" CHANGELOG.md | head -n -1) | |
# Remove the version header line and clean up | |
CHANGELOG_CONTENT=$(echo "$CHANGELOG_SECTION" | tail -n +2 | sed '/^$/N;/^\n$/d') | |
# Save to file and output | |
echo "$CHANGELOG_CONTENT" > release_notes.md | |
echo "changelog_found=true" >> $GITHUB_OUTPUT | |
else | |
echo "No changelog found for version $VERSION" > release_notes.md | |
echo "changelog_found=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: elixir-ls-v${{ needs.build.outputs.version }}.zip | |
body_path: release_notes.md | |
draft: true | |
prerelease: ${{ needs.build.outputs.is_prerelease == 'true' }} | |
name: "ElixirLS ${{ needs.build.outputs.version }}" | |
tag_name: "v${{ needs.build.outputs.version }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Run final validation tests on the release | |
test_release: | |
name: Test release artifact | |
runs-on: ubuntu-22.04 | |
needs: build | |
steps: | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: elixir-ls-${{ needs.build.outputs.version }} | |
- name: Test release artifact | |
run: | | |
# Basic smoke test - extract and verify structure | |
unzip -q elixir-ls-v${{ needs.build.outputs.version }}.zip | |
# Check that essential files exist | |
test -f language_server.sh || exit 1 | |
test -f debug_adapter.sh || exit 1 | |
# Check that the scripts are executable | |
test -x language_server.sh || exit 1 | |
test -x debug_adapter.sh || exit 1 | |
echo "✅ Release artifact validation passed" |