Repository navigation
61 lines (57 loc) · 2.21 KB
/
Copy pathrelease-image.yml
File metadata and controls
61 lines (57 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Release image
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
version:
description: 'Semver image version, for example 0.2.0'
required: true
jobs:
release:
permissions:
contents: read
packages: write
# Keyless cosign signing exchanges this job's OIDC token for a
# short-lived Fulcio certificate; no key material is stored anywhere.
# A reusable workflow's permissions can only be narrowed by the
# caller, never widened, so this job must grant them itself -- see
# mecmcp's docs/RELEASE-WORKFLOWS.md.
id-token: write
uses: mechubsec/mecmcp/.github/workflows/reusable-release-image.yml@78f0b978cf67ca10547cce4c15111eb7a872d886 # v0.33.2
with:
# GHCR requires a lowercase image path; github.repository is already lowercase.
image: ghcr.io/${{ github.repository }}
# Dual-push (mecmcp MEC-2110). Docker Hub org is `mechub`.
dockerhub-image: docker.io/mechub/rustpanosmcp
description: 'PAN-OS MCP server'
version: ${{ github.event.inputs.version }}
secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
tag-version:
name: Resolve tag version
# reusable-registry-publish.yml re-verifies the pushed tag's signature
# itself and has no workflow_dispatch story, so this job (and the
# registry-publish job below) only runs for the tag-push trigger.
if: github.event_name == 'push'
permissions: {}
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Strip leading v from the pushed tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
registry-publish:
name: Publish to MCP Registry
if: github.event_name == 'push'
needs: [release, tag-version]
permissions:
contents: read
id-token: write
uses: mechubsec/mecmcp/.github/workflows/reusable-registry-publish.yml@78f0b978cf67ca10547cce4c15111eb7a872d886 # v0.33.2
with:
version: ${{ needs.tag-version.outputs.version }}
oci-image: ghcr.io/${{ github.repository }}:${{ needs.tag-version.outputs.version }}