diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c918a19..275ce28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,12 @@ on: push: tags: - "[0-9]+.[0-9]+.[0-9]+*" # Trigger on version tags like 1.0.0, 2.1.0, etc. + workflow_dispatch: + inputs: + version: + description: "Version to release (e.g., 2.8.0)" + required: true + type: string jobs: release: @@ -42,9 +48,18 @@ jobs: echo "DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG || 'worker-v1-vllm' }}" >> $GITHUB_ENV echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV - # For tags, use the tag name as version (remove refs/tags/ prefix) - VERSION=${GITHUB_REF#refs/tags/} - echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV + # Determine version based on trigger type + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + # Manual trigger: use input version + VERSION="${{ github.event.inputs.version }}" + echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV + echo "IS_MANUAL_RELEASE=true" >> $GITHUB_ENV + else + # Tag trigger: use tag name (remove refs/tags/ prefix) + VERSION=${GITHUB_REF#refs/tags/} + echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV + echo "IS_MANUAL_RELEASE=false" >> $GITHUB_ENV + fi - name: Build and push the images to Docker Hub uses: docker/bake-action@v2 @@ -57,6 +72,7 @@ jobs: *.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }} - name: Create GitHub Release + if: env.IS_MANUAL_RELEASE == 'false' uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -72,3 +88,11 @@ jobs: See [commit history](https://github.com/${{ github.repository }}/commits/${{ github.ref_name }}) for detailed changes. draft: false prerelease: false + + - name: Manual Release Summary + if: env.IS_MANUAL_RELEASE == 'true' + run: | + echo "🚀 Manual release completed!" + echo "Version: ${{ env.RELEASE_VERSION }}" + echo "Docker Image: ${{ env.DOCKERHUB_REPO }}/${{ env.DOCKERHUB_IMG }}:${{ env.RELEASE_VERSION }}" + echo "Note: No GitHub release created for manual triggers"