|
| 1 | +name: Tag and Push |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*.*.*" |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + version: |
| 10 | + description: 'Version number' |
| 11 | + |
| 12 | +# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#release |
| 13 | +# GITHUB_SHA = Last commit in the tagged release |
| 14 | +# GITHUB_REF = Tag ref of release refs/tags/<tag_name> |
| 15 | +jobs: |
| 16 | + push-images: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + permissions: |
| 19 | + contents: read |
| 20 | + packages: write |
| 21 | + steps: |
| 22 | + - name: 'Checkout GitHub Action' |
| 23 | + uses: actions/checkout@main |
| 24 | + |
| 25 | + - name: Login to GitHub Container Registry |
| 26 | + uses: docker/login-action@v3 |
| 27 | + with: |
| 28 | + registry: ghcr.io |
| 29 | + username: ${{ github.actor }} |
| 30 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + |
| 32 | + - name: Set up QEMU |
| 33 | + uses: docker/setup-qemu-action@v3 |
| 34 | + - name: Set up Docker Buildx |
| 35 | + uses: docker/setup-buildx-action@v3 |
| 36 | + |
| 37 | + - name: 'Build Images' |
| 38 | + env: |
| 39 | + DOCKER_BUILD_ARGS: "--push --platform linux/amd64,linux/arm64" |
| 40 | + run: | |
| 41 | + # if workflow_dispatch is used, use the version input |
| 42 | + if [ -n "${{ github.event.inputs.version }}" ]; then |
| 43 | + export VERSION=${{ github.event.inputs.version }} |
| 44 | + else |
| 45 | + export VERSION=$(echo "$GITHUB_REF" | cut -c12-) |
| 46 | + fi |
| 47 | + make build-mcp |
| 48 | +
|
| 49 | + release: |
| 50 | + # Only run release after images and helm chart are pushed |
| 51 | + # In the future we can take the chart from the helm action, |
| 52 | + # and build the CLI beforehand. |
| 53 | + needs: |
| 54 | + - push-images |
| 55 | + runs-on: ubuntu-latest |
| 56 | + permissions: |
| 57 | + contents: write |
| 58 | + steps: |
| 59 | + - name: Checkout |
| 60 | + uses: actions/checkout@v4 |
| 61 | + - name: Release |
| 62 | + uses: softprops/action-gh-release@v2 |
| 63 | + if: startsWith(github.ref, 'refs/tags/') |
0 commit comments