-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (134 loc) · 4.58 KB
/
Copy pathrelease.yml
File metadata and controls
141 lines (134 loc) · 4.58 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Release MemoryProof / 发布 MemoryProof
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
binaries:
name: Build ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: linux-x86_64
archive: memoryproof-linux-x86_64.tar.gz
shell: bash
- os: macos-15-intel
name: macos-x86_64
archive: memoryproof-macos-x86_64.tar.gz
shell: bash
- os: macos-14
name: macos-arm64
archive: memoryproof-macos-arm64.tar.gz
shell: bash
- os: windows-latest
name: windows-x86_64
archive: memoryproof-windows-x86_64.zip
shell: pwsh
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --release --bins
- name: Package Unix binaries
if: runner.os != 'Windows'
run: tar -czf "${{ matrix.archive }}" -C target/release memoryproof forgetproof -C "$GITHUB_WORKSPACE" python/forgetproof_adapters
- name: Package Windows binaries
if: runner.os == 'Windows'
shell: pwsh
run: Compress-Archive -Path target/release/memoryproof.exe,target/release/forgetproof.exe,python/forgetproof_adapters -DestinationPath "${{ matrix.archive }}"
- uses: actions/upload-artifact@v7
with:
name: binary-${{ matrix.name }}
path: ${{ matrix.archive }}
python:
name: Build Python distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.11"
- run: python -m pip install --upgrade build
- run: python -m build
- uses: actions/upload-artifact@v7
with:
name: python-package
path: dist/
release:
name: Create GitHub release
needs: [binaries, python]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
path: dist
pattern: binary-*
merge-multiple: true
- uses: actions/download-artifact@v8
with:
name: python-package
path: dist
- name: Create or update release
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
gh release upload "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" dist/* --clobber
else
gh release create "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" \
--title "MemoryProof ${GITHUB_REF_NAME}" --generate-notes dist/*
fi
container:
name: Publish OCI image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push multi-architecture image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/hughhhhcoder/memoryproof:${{ github.ref_name }}
ghcr.io/hughhhhcoder/memoryproof:1
ghcr.io/hughhhhcoder/memoryproof:latest
labels: |
org.opencontainers.image.source=https://github.com/Hughhhhcoder/MemoryProof
org.opencontainers.image.description=Evidence-driven memory assurance for AI agents
annotations: |
manifest:org.opencontainers.image.title=MemoryProof
manifest:org.opencontainers.image.description=Evidence-driven memory assurance for AI agents
manifest:org.opencontainers.image.source=https://github.com/Hughhhhcoder/MemoryProof
manifest:org.opencontainers.image.licenses=Apache-2.0
provenance: mode=max
sbom: true
publish-pypi:
name: Publish PyPI package (opt-in)
if: vars.PUBLISH_PYPI == 'true' && startsWith(github.ref, 'refs/tags/v')
needs: python
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/memoryproof-adapters
steps:
- uses: actions/download-artifact@v8
with:
name: python-package
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1