98 lines
3.4 KiB
YAML
98 lines
3.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
push:
|
|
tags:
|
|
- "v[0-9]+.[0-9]+.[0-9]+*"
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "Version to release (e.g., v2.8.0)"
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write # Required for creating GitHub releases
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: [blacksmith-8vcpu-ubuntu-2204, linux]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Clear space to remove unused folders
|
|
run: |
|
|
rm -rf /usr/share/dotnet
|
|
rm -rf /opt/ghc
|
|
rm -rf "/usr/local/share/boost"
|
|
rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: blacksmith docker layer cache
|
|
uses: useblacksmith/build-push-action@v1
|
|
with:
|
|
setup-only: true
|
|
|
|
- name: Set environment variables
|
|
run: |
|
|
echo "DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO || 'runpod' }}" >> $GITHUB_ENV
|
|
echo "DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG || 'worker-v1-vllm' }}" >> $GITHUB_ENV
|
|
echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV
|
|
|
|
# Determine version based on trigger type
|
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
VERSION="${{ github.event.inputs.version }}"
|
|
elif [[ "${{ github.event_name }}" == "release" ]]; then
|
|
VERSION="${{ github.event.release.tag_name }}"
|
|
else
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
fi
|
|
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
|
|
|
|
- name: Build and push the images to Docker Hub
|
|
uses: docker/bake-action@v2
|
|
with:
|
|
push: true
|
|
set: |
|
|
*.args.DOCKERHUB_REPO=${{ env.DOCKERHUB_REPO }}
|
|
*.args.DOCKERHUB_IMG=${{ env.DOCKERHUB_IMG }}
|
|
*.args.RELEASE_VERSION=${{ env.RELEASE_VERSION }}
|
|
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }}
|
|
|
|
- name: Release Summary
|
|
run: |
|
|
echo "Release completed!"
|
|
echo "Version: ${{ env.RELEASE_VERSION }}"
|
|
echo "Docker Image: ${{ env.DOCKERHUB_REPO }}/${{ env.DOCKERHUB_IMG }}:${{ env.RELEASE_VERSION }}"
|
|
|
|
- name: Notify Slack
|
|
run: |
|
|
curl -sf -X POST "${{ secrets.SLACK_WEBHOOK_URL }}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"text": ":rocket: New :runpod-new-whiteonpurple: Runpod worker-vllm release: *${{ env.RELEASE_VERSION }}*",
|
|
"blocks": [
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": ":banana-dance: *New Release — worker-vllm ${{ env.RELEASE_VERSION }}*\n*Docker:* `${{ env.DOCKERHUB_REPO }}/${{ env.DOCKERHUB_IMG }}:${{ env.RELEASE_VERSION }}`\n<https://github.com/${{ github.repository }}/releases/tag/${{ env.RELEASE_VERSION }}|View release on GitHub>"
|
|
}
|
|
}
|
|
]
|
|
}'
|