|
1 |
| -name: Release |
| 1 | +name: release |
| 2 | + |
2 | 3 | env:
|
3 | 4 | PACKAGE_NAME: "mcp-server-drupal"
|
4 | 5 | TARGET_LIST: "x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,x86_64-pc-windows-msvc,x86_64-apple-darwin,aarch64-apple-darwin"
|
| 6 | + REGISTRY: ghcr.io |
| 7 | + IMAGE_NAME: omedia/mcp-server-drupal |
| 8 | + |
5 | 9 | on:
|
6 | 10 | push:
|
7 | 11 | tags:
|
8 | 12 | - "v*.*.*"
|
| 13 | + |
9 | 14 | permissions:
|
10 | 15 | contents: write
|
11 | 16 | id-token: write
|
| 17 | + packages: write |
| 18 | + |
12 | 19 | jobs:
|
13 |
| - build-and-sign: |
| 20 | + binary: |
14 | 21 | runs-on: ubuntu-latest
|
15 | 22 | steps:
|
16 | 23 | - name: Checkout code
|
17 | 24 | uses: actions/checkout@v4
|
| 25 | + |
18 | 26 | - name: Setup Deno
|
19 | 27 | uses: denoland/setup-deno@v2
|
20 | 28 | with:
|
21 | 29 | deno-version: "2.x"
|
| 30 | + |
22 | 31 | - name: Extract version from tag
|
23 | 32 | run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
| 33 | + |
24 | 34 | - name: Setup cosign
|
25 | 35 |
|
| 36 | + |
26 | 37 | - name: Build the binaries
|
27 | 38 | run: |
|
28 | 39 | for target in $(echo $TARGET_LIST | tr "," "\n")
|
|
47 | 58 |
|
48 | 59 | deno task build --target=$target --output=./build/$binary_name
|
49 | 60 | done
|
| 61 | +
|
50 | 62 | - name: Sign binaries
|
51 | 63 | run: |
|
52 | 64 | mkdir -p build/bundles
|
|
60 | 72 | cd build/bundles
|
61 | 73 | tar -czf ../signatures.tar.gz *
|
62 | 74 | cd ../..
|
| 75 | +
|
63 | 76 | - name: Release
|
64 | 77 | uses: softprops/action-gh-release@v2
|
65 | 78 | with:
|
66 | 79 | files: |
|
67 | 80 | build/*
|
68 | 81 | name: "MCP Server Drupal: ${{ env.VERSION }}"
|
| 82 | + |
| 83 | + docker: |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Checkout repository |
| 87 | + uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Extract version from tag |
| 90 | + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV |
| 91 | + |
| 92 | + - name: Set up Docker Buildx |
| 93 | + uses: docker/setup-buildx-action@v3 |
| 94 | + |
| 95 | + - name: Login to GitHub Container Registry |
| 96 | + uses: docker/login-action@v3 |
| 97 | + with: |
| 98 | + registry: ${{ env.REGISTRY }} |
| 99 | + username: ${{ github.actor }} |
| 100 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 101 | + |
| 102 | + - name: Extract metadata for Docker |
| 103 | + id: meta |
| 104 | + uses: docker/metadata-action@v5 |
| 105 | + with: |
| 106 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 107 | + tags: | |
| 108 | + type=semver,pattern={{version}} |
| 109 | + type=raw,value=latest |
| 110 | + labels: | |
| 111 | + org.opencontainers.image.source=https://github.com/omedia/mcp-server-drupal |
| 112 | + org.opencontainers.image.description=MCP Server for Drupal |
| 113 | + org.opencontainers.image.licenses=MIT |
| 114 | + org.opencontainers.image.version=${{ env.VERSION }} |
| 115 | + org.opencontainers.image.created={{date 'iso8601'}} |
| 116 | +
|
| 117 | + - name: Build and push Docker image |
| 118 | + uses: docker/build-push-action@v5 |
| 119 | + with: |
| 120 | + context: . |
| 121 | + push: true |
| 122 | + tags: ${{ steps.meta.outputs.tags }} |
| 123 | + labels: ${{ steps.meta.outputs.labels }} |
| 124 | + cache-from: type=gha |
| 125 | + cache-to: type=gha,mode=max |
| 126 | + platforms: linux/amd64,linux/arm64 |
| 127 | + |
| 128 | + - name: Sign the images with Cosign |
| 129 | + |
| 130 | + |
| 131 | + - name: Sign container image |
| 132 | + run: | |
| 133 | + cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} |
| 134 | + cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |
0 commit comments