Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions .github/workflows/wrappers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Build the compiled Python and MATLAB packages in `lib/` and attach them to a
# release. `workflow_dispatch` runs the same builds and smoke tests without
# publishing; the results are then kept as workflow artifacts.
# Build the compiled Python and MATLAB packages in `lib/`, run their smoke
# tests, and keep them as workflow artifacts. A run for a version tag (pushed by
# TagBot, or started by hand with `--ref <tag>`) also attaches them to that
# tag's release. The trigger is the tag push, not the release: TagBot creates
# releases with `GITHUB_TOKEN`, whose events start no workflows.
name: Wrappers
on:
release:
types: [published]
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: write
Expand Down Expand Up @@ -44,20 +46,30 @@ jobs:
- name: Compile the gateway and run the smoke test
uses: matlab-actions/run-command@v3
with:
command: cd('lib/out'); build_mex; run('../test/matlab/smoke.m')
command: cd('lib/out'); build_mex; addpath(pwd); run('../test/matlab/smoke.m')
- name: Collect what a caller needs
run: |
cd lib/out
tar czf "$GITHUB_WORKSPACE/matrixcovers-matlab-glnxa64.tar.gz" \
+matrixcovers matrixcovers-bundle build_mex.m
- name: Attach to the release
if: github.event_name == 'release'
run: gh release upload "${{ github.event.release.tag_name }}" matrixcovers-matlab-glnxa64.tar.gz --clobber
env:
GH_TOKEN: ${{ github.token }}
- uses: actions/upload-artifact@v7
if: github.event_name != 'release'
with:
name: matrixcovers-matlab-glnxa64
path: matrixcovers-matlab-glnxa64.tar.gz
if-no-files-found: error

attach:
# TagBot creates the release right after pushing the tag; if it does not
# exist yet, the upload fails and this job can be rerun.
needs: [python, matlab]
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v7
with:
path: assets
merge-multiple: true
- name: Attach to the release
run: gh release upload "$GITHUB_REF_NAME" assets/* --clobber --repo "$GITHUB_REPOSITORY"
env:
GH_TOKEN: ${{ github.token }}
2 changes: 1 addition & 1 deletion lib/build-env/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ JuliaLibWrapping = "d61f35a8-f6af-436f-bc10-cee6b101f7bd"

[compat]
JuliaC = "0.3.10"
JuliaLibWrapping = "0.3"
JuliaLibWrapping = "0.3.3"
julia = "1.13"
5 changes: 3 additions & 2 deletions lib/test/matlab/smoke.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
% Smoke test for the matrixcovers MATLAB package. Run from the build output
% directory after `build_mex`. Reference values are those of MatrixCovers.jl.
% Smoke test for the matrixcovers MATLAB package. Run `build_mex` in the build
% output directory and add that directory to the path first. Reference values
% are those of MatrixCovers.jl.

As = [4 1 0.5; 1 3 0.2; 0.5 0.2 2];
Aa = [1 2 3; 6 5 4; 0.5 0 2];
Expand Down
Loading