114
env:
115
VERSION: ${{ steps.meta.outputs.version }}
116
RELEASE_TAG: ${{ steps.release.outputs.release_tag }}
117
- run: test -n "$RELEASE_TAG" && test "$RELEASE_TAG" = "$VERSION"
117
+ run: |
118
+ if [ -z "$RELEASE_TAG" ]; then
119
+ echo "::error::release_tag is required when publish=true on workflow_dispatch runs."
120
+ exit 1
121
+ fi
122
+ # Ed tags carry a `v` prefix, version.txt does not, so compare the
123
+ # semver rather than the spelling -- the same normalisation preflight
124
+ # does on GITHUB_REF_NAME.
125
+ if [ "${RELEASE_TAG#v}" != "$VERSION" ]; then
126
+ echo "::error::Release tag '$RELEASE_TAG' does not match workspace version '$VERSION'."
127
+ exit 1
128
+ fi
129
- name: Upload build artifact
130
if: github.event_name == 'workflow_dispatch'
131
uses: actions/upload-artifact@v7
146
files: |
147
ed/dist/swift/EdFramework.xcframework.zip
148
ed/dist/swift/EdFramework.checksum.txt
138
- - name: Checkout onde-ed-swift
149
+ - name: Checkout ed-swift
150
if: startsWith(github.ref, 'refs/tags/') || inputs.publish
151
uses: actions/checkout@v6
152
with:
142
- repository: ondeinference/onde-ed-swift
153
+ repository: ondeinference/ed-swift
154
token: ${{ secrets.ED_SWIFT_PAT }}
144
- path: onde-ed-swift
155
+ path: ed-swift
156
- name: Update Swift package
157
if: startsWith(github.ref, 'refs/tags/') || inputs.publish
158
working-directory: ${{ github.workspace }}
162
run: |
163
python3 - <<'PY'
164
import os, pathlib, re
154
- package = pathlib.Path("onde-ed-swift/Package.swift")
165
+ package = pathlib.Path("ed-swift/Package.swift")
166
source = package.read_text()
167
source, urls = re.subn(r'(let releaseFrameworkURL =\s*\n\s*")([^"]+)(")', rf'\g<1>{os.environ["RELEASE_URL"]}\g<3>', source, count=1)
168
source, sums = re.subn(r'(let releaseFrameworkChecksum =\s*\n\s*")([^"]+)(")', rf'\g<1>{os.environ["CHECKSUM"]}\g<3>', source, count=1)
170
raise RuntimeError("Package.swift release constants were not found")
171
package.write_text(source)
172
PY
162
- cp ed/dist/swift/Package/Sources/Ed/ed_agent_ffi.swift onde-ed-swift/Sources/Ed/ed_agent_ffi.swift
173
+ cp ed/dist/swift/Package/Sources/Ed/ed_agent_ffi.swift ed-swift/Sources/Ed/ed_agent_ffi.swift
174
- name: Commit and tag Swift package
175
if: startsWith(github.ref, 'refs/tags/') || inputs.publish
165
- working-directory: ${{ github.workspace }}/onde-ed-swift
176
+ working-directory: ${{ github.workspace }}/ed-swift
177
env:
178
VERSION: ${{ steps.release.outputs.release_tag }}
179
run: |