-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (71 loc) · 2.1 KB
/
release.yml
File metadata and controls
75 lines (71 loc) · 2.1 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
packages: write
id-token: write
jobs:
pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build
run: |
python -m pip install --upgrade pip build
python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
docker:
name: Build, sign, & push image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: build
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/ghost-memory:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/ghost-memory:latest
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Sign container image (keyless / sigstore)
env:
COSIGN_EXPERIMENTAL: "1"
run: |
cosign sign --yes \
ghcr.io/${{ github.repository_owner }}/ghost-memory@${{ steps.build.outputs.digest }}
- name: Generate SBOM (SPDX)
uses: anchore/sbom-action@v0
with:
image: ghcr.io/${{ github.repository_owner }}/ghost-memory:${{ github.ref_name }}
format: spdx-json
output-file: sbom-${{ github.ref_name }}.spdx.json
- name: Attest SBOM
env:
COSIGN_EXPERIMENTAL: "1"
run: |
cosign attest --yes \
--predicate sbom-${{ github.ref_name }}.spdx.json \
--type spdxjson \
ghcr.io/${{ github.repository_owner }}/ghost-memory@${{ steps.build.outputs.digest }}