|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
| 7 | + - feat/* |
7 | 8 | paths: |
8 | 9 | - pyproject.toml |
9 | 10 | workflow_dispatch: |
10 | 11 |
|
11 | 12 |
|
12 | 13 | jobs: |
| 14 | + |
13 | 15 | push_to_registry: |
14 | 16 | name: Push Docker image to GitHub Packages |
15 | 17 | runs-on: ubuntu-latest |
16 | 18 | permissions: |
17 | 19 | contents: read # required for actions/checkout |
18 | 20 | packages: write # required for pushing to ghcr.io |
19 | 21 | id-token: write # required for signing with cosign |
| 22 | + outputs: |
| 23 | + version: ${{ steps.extract_version.outputs.VERSION }} |
| 24 | + tag: ${{ steps.extract_version.outputs.TAG }} |
20 | 25 | steps: |
21 | 26 | - name: Check out the repo |
22 | 27 | uses: actions/checkout@v4 |
|
26 | 31 | run: | |
27 | 32 | VERSION=$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')-$(echo $GITHUB_SHA | cut -c1-7) |
28 | 33 | echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" |
| 34 | + TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/') |
| 35 | + echo "TAG=$TAG" >> "$GITHUB_OUTPUT" |
29 | 36 |
|
30 | 37 | - name: Log in to GitHub Container Registry |
31 | 38 | uses: docker/login-action@v3 |
|
56 | 63 | ghcr.io/sysdiglabs/sysdig-mcp-server:v${{ steps.extract_version.outputs.VERSION }} |
57 | 64 | DIGEST: ${{ steps.build-and-push.outputs.digest }} |
58 | 65 | run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} |
| 66 | + |
| 67 | + tag_release: |
| 68 | + name: Tag Release |
| 69 | + runs-on: ubuntu-latest |
| 70 | + needs: push_to_registry |
| 71 | + steps: |
| 72 | + - name: Check out the repo |
| 73 | + uses: actions/checkout@v4 |
| 74 | + |
| 75 | + - name: Semantic Release |
| 76 | + uses: cycjimmy/semantic-release-action@v4 |
| 77 | + id: semantic_release |
| 78 | + with: |
| 79 | + dry_run: true |
| 80 | + branches: | |
| 81 | + [ |
| 82 | + '+([0-9])?(.{+([0-9]),x}).x', |
| 83 | + 'main', |
| 84 | + { |
| 85 | + name: 'beta', |
| 86 | + prerelease: true |
| 87 | + }, |
| 88 | + { |
| 89 | + name: 'alpha', |
| 90 | + prerelease: true |
| 91 | + } |
| 92 | + ] |
| 93 | +
|
| 94 | + - name: Summary |
| 95 | + run: | |
| 96 | + echo "## Release Summary |
| 97 | + - Tag: ${{ steps.semantic_release.outputs.new_release_version }} |
| 98 | + - Docker Image: ghcr.io/sysdiglabs/sysdig-mcp-server:v${{ steps.extract_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY |
0 commit comments