From b5022bf565596cfd3fda977de2828f254e20b7b4 Mon Sep 17 00:00:00 2001 From: kilyabin <65072190+kilyabin@users.noreply.github.com> Date: Tue, 10 Mar 2026 01:14:51 +0400 Subject: [PATCH] feat: auto-release on every push to main - Trigger release workflow on push to main branch - Auto-generate version from date + commit hash (e.g., v2026.03.10-abc1234) - Delete previous draft releases to avoid accumulation - Publish releases automatically (not as drafts) - Mark releases as prerelease --- .github/workflows/release.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e294ff6..0b86773 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,7 @@ name: Build & Release on: push: - tags: - - "v*" + branches: ["main"] permissions: contents: write @@ -55,6 +54,15 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate version from commit + id: version + run: | + VERSION="v$(date +%Y.%m.%d)-$(git rev-parse --short HEAD)" + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Generated version: $VERSION" - name: Download all artifacts uses: actions/download-artifact@v4 @@ -75,9 +83,17 @@ jobs: done ls -la + - name: Delete existing draft release + uses: hugo19941951/delete-draft-releases@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Release uses: softprops/action-gh-release@v1 with: + tag_name: ${{ steps.version.outputs.version }} + name: Release ${{ steps.version.outputs.version }} files: artifacts/* generate_release_notes: true - draft: true + draft: false + prerelease: true