Skip to content

Commit a6e569f

Browse files
committed
Prepared for toolbox release workflow and updated to new 2025 package format
1 parent 1b2ec3f commit a6e569f

File tree

370 files changed

+1390
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+1390
-177
lines changed

.gitattributes

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
* text=auto
2+
3+
*.fig binary
4+
*.mat binary
5+
*.mdl binary diff merge=mlAutoMerge
6+
*.mdlp binary
7+
*.mex* binary
8+
*.mlapp binary
9+
*.mldatx binary merge=mlAutoMerge
10+
*.mlproj binary
11+
*.mlx binary
12+
*.p binary
13+
*.plprj binary
14+
*.sbproj binary
15+
*.sfx binary
16+
*.sldd binary
17+
*.slreqx binary merge=mlAutoMerge
18+
*.slmx binary merge=mlAutoMerge
19+
*.sltx binary
20+
*.slxc binary
21+
*.slx binary merge=mlAutoMerge
22+
*.slxp binary
23+
24+
## MATLAB Project metadata files use LF line endings
25+
/resources/project/**/*.xml text eol=lf
26+
27+
## Other common binary file types
28+
*.docx binary
29+
*.exe binary
30+
*.jpg binary
31+
*.pdf binary
32+
*.png binary
33+
*.xlsx binary

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Release workflow - creates GitHub releases with toolbox binaries
2+
# Triggered when you push a version tag (e.g., v3.0.2)
3+
4+
name: Release
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*' # Triggers on version tags like v3.0.2
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
19+
# Set up MATLAB and other MathWorks products on the runner.
20+
- name: Set up MATLAB
21+
uses: matlab-actions/setup-matlab@v2
22+
with:
23+
release: latest
24+
cache: true
25+
products: Statistics_and_Machine_Learning_Toolbox Curve_Fitting_Toolbox
26+
27+
- name: Build toolbox
28+
uses: matlab-actions/run-command@v2
29+
with:
30+
command: |
31+
version = erase('${{ github.ref_name }}', 'v');
32+
createMLTBX('gramm_packaging.prj', version);
33+
34+
- name: Create Release
35+
uses: softprops/action-gh-release@v1
36+
with:
37+
files: gramm*.mltbx
38+
draft: true
39+
generate_release_notes: true

GITHUB_ACTIONS.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# GitHub Actions Workflow Guide
2+
3+
This document explains how to use the GitHub Actions workflows configured for the gramm repository.
4+
5+
## Overview
6+
7+
The repository has two automated workflows:
8+
9+
1. **matlab.yml** - Continuous testing (runs on every push/PR)
10+
2. **release.yml** - Release automation (runs when you create version tags)
11+
12+
---
13+
14+
## Testing Workflow (matlab.yml)
15+
16+
### When it runs
17+
- Automatically on every push to `master` branch
18+
- Automatically on every pull request
19+
- Can be manually triggered from GitHub Actions tab
20+
21+
### What it does
22+
1. Checks out the code
23+
2. Sets up MATLAB with required toolboxes (Statistics, Curve Fitting)
24+
3. Runs `buildtool` which executes:
25+
- Code quality checks (stores results in `issues.mat`)
26+
- Tests from `test_examples_dev.m`
27+
- Generates code coverage report
28+
4. Uploads test artifacts:
29+
- `testresults.html` - Test results report
30+
- `coverageresults.html` - Code coverage report
31+
- `release/` - Supporting files for HTML reports
32+
33+
### Viewing test results
34+
1. Go to your repository on GitHub.com
35+
2. Click "Actions" tab
36+
3. Click on a workflow run
37+
4. Scroll to bottom → "Artifacts" section
38+
5. Download "test-results" zip file
39+
6. Open the HTML files in your browser
40+
41+
---
42+
43+
## Release Workflow (release.yml)
44+
45+
### Creating a release
46+
47+
**Recommended method (via command line):**
48+
49+
```bash
50+
# Create an annotated tag
51+
git tag -a v3.0.2 -m "Release version 3.0.2"
52+
53+
# Push the tag to GitHub
54+
git push origin v3.0.2
55+
```
56+
57+
**Alternative method (via GitHub.com):**
58+
59+
1. Go to repository on GitHub.com
60+
2. Click "Releases" (right sidebar)
61+
3. Click "Draft a new release"
62+
4. Click "Choose a tag" → type `v3.0.2` → "Create new tag"
63+
5. Click "Save draft" (don't add anything yet)
64+
65+
### What happens automatically
66+
67+
Once you push a tag (starting with `v`), the workflow:
68+
69+
1. Sets up MATLAB with required toolboxes
70+
2. Extracts version number from tag (removes 'v' prefix)
71+
3. Runs `createMLTBX('gramm_packaging.prj', version)`
72+
4. Creates a **draft release** with:
73+
- Your `.mltbx` toolbox file attached
74+
- Auto-generated release notes from commits
75+
76+
### Publishing the release
77+
78+
1. Go to GitHub.com → Releases
79+
2. Find your draft release
80+
3. Edit the release notes as needed
81+
4. Click "Publish release" when ready
82+
83+
The `.mltbx` file will be available for download on the release page.
84+
85+
---
86+
87+
## Tag Naming Convention
88+
89+
- Use semantic versioning: `v[major].[minor].[patch]`
90+
- Examples: `v3.0.0`, `v3.0.1`, `v3.1.0`
91+
- Always include the `v` prefix (it gets removed automatically for the toolbox)
92+
93+
---
94+
95+
## Troubleshooting
96+
97+
### Workflow failed
98+
- Check the Actions tab for error details
99+
- Test artifacts are uploaded even if tests fail (use `if: always()`)
100+
- Common issues:
101+
- Missing dependencies
102+
- MATLAB code errors
103+
- Path issues with `sample_data/`
104+
105+
### Release didn't create
106+
- Verify tag starts with `v`
107+
- Check Actions tab for workflow run
108+
- Make sure `gramm_packaging.prj` exists and is valid
109+
110+
### Can't see test results
111+
- Make sure workflow completed
112+
- Artifacts expire after 90 days by default
113+
- Download and extract the zip file completely before opening HTML files

gramm.prj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<MATLABProject xmlns="http://www.mathworks.com/MATLABProjectFile"/>

gramm/doc/examples.mlx

0 Bytes
Binary file not shown.

gramm/html/GettingStarted.html

Lines changed: 4 additions & 5 deletions
Large diffs are not rendered by default.

gramm/html/Groups.html

Lines changed: 4 additions & 5 deletions
Large diffs are not rendered by default.

gramm/html/OnlineTable.html

Lines changed: 3 additions & 4 deletions
Large diffs are not rendered by default.

gramm/html/TimeSeries.html

Lines changed: 4 additions & 5 deletions
Large diffs are not rendered by default.

gramm/html/XY.html

Lines changed: 4 additions & 5 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)