Skip to content

Commit 69f2876

Browse files
committed
feat: simplify to single workflow with automatic pre-releases
- Modify release.yml to trigger on commits instead of tags - Auto-generate version tags based on branch and commit SHA - Always create pre-releases for commits (can manually promote later) - Remove separate build.yml workflow to avoid confusion - Use format: v{branch}-{short-sha} for automatic releases - Add build information to release notes - Set makeLatest: false to prevent auto-promotion Now every commit creates a pre-release that can be manually promoted to stable.
1 parent d422f35 commit 69f2876

2 files changed

Lines changed: 31 additions & 328 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 321 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ name: Build and Release CLI
22

33
on:
44
push:
5-
tags:
6-
- "v*"
5+
branches: [dev, beta, main]
6+
paths-ignore:
7+
- '**.md'
8+
- 'docs/**'
9+
- '.gitignore'
10+
- 'LICENSE'
711
workflow_dispatch:
812
inputs:
913
prerelease:
@@ -361,20 +365,40 @@ jobs:
361365
# List files
362366
ls -la
363367
368+
- name: Generate version tag
369+
id: version
370+
run: |
371+
if [ "${{ github.event_name }}" = "push" ]; then
372+
# For commits, create version based on branch and short commit
373+
BRANCH="${{ github.ref_name }}"
374+
SHORT_SHA="$(echo ${{ github.sha }} | cut -c1-7)"
375+
VERSION="${BRANCH}-${SHORT_SHA}"
376+
echo "tag=v${VERSION}" >> $GITHUB_OUTPUT
377+
echo "name=EncryptX CLI v${VERSION} (Pre-release)" >> $GITHUB_OUTPUT
378+
echo "prerelease=true" >> $GITHUB_OUTPUT
379+
else
380+
# For manual dispatch, use current date
381+
VERSION="manual-$(date +%Y%m%d-%H%M%S)"
382+
echo "tag=v${VERSION}" >> $GITHUB_OUTPUT
383+
echo "name=EncryptX CLI v${VERSION}" >> $GITHUB_OUTPUT
384+
echo "prerelease=${{ github.event.inputs.prerelease }}" >> $GITHUB_OUTPUT
385+
fi
386+
364387
- name: Create Release
365388
uses: ncipollo/release-action@v1.14.0
366389
with:
367390
artifacts: "release-assets/*"
368391
token: ${{ secrets.GITHUB_TOKEN }}
369-
name: "EncryptX CLI v${{ github.ref_name }}"
370-
tag: ${{ github.ref_name }}
371-
prerelease: ${{ github.event_name == 'push' || github.event.inputs.release_type == 'prerelease' || github.event.inputs.prerelease == true || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') || contains(github.ref_name, 'rc') || contains(github.ref_name, 'dev') }}
392+
name: "${{ steps.version.outputs.name }}"
393+
tag: "${{ steps.version.outputs.tag }}"
394+
prerelease: ${{ steps.version.outputs.prerelease }}
395+
makeLatest: false
372396
body: |
373-
# EncryptX CLI ${{ github.ref_name }}
397+
# EncryptX CLI ${{ steps.version.outputs.tag }}
374398
375399
🔐 **Secure file encryption tool with AES-256-GCM encryption**
376400
377-
${{ github.event_name == 'push' && '⚠️ **Pre-release**: This is an automated pre-release from tag push. Use with caution in production.' || '' }}
401+
${{ github.event_name == 'push' && '⚠️ **Pre-release**: This is an automated pre-release from commit. Use with caution in production.' || '' }}
378402
${{ github.event.inputs.release_type == 'prerelease' && '⚠️ **Pre-release**: This is a pre-release version. Use with caution in production.' || '' }}
379403
380404
## 📦 Downloads

0 commit comments

Comments
 (0)