Skip to content

Commit f22862a

Browse files
authored
Improve release creation triggers and add caching to CircleCI toolbox distribution example (#10)
1 parent 864d138 commit f22862a

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

.circleci/ToolboxDistribution.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
steps:
2626
- checkout
2727

28-
- matlab/install
28+
- matlab/install:
29+
cache: true
2930

3031
# Runs build to create MEX file and then run tests
3132
- matlab/run-build:
@@ -48,7 +49,8 @@ jobs:
4849
steps:
4950
- checkout
5051

51-
- matlab/install
52+
- matlab/install:
53+
cache: true
5254

5355
# Downloads all mex files from previous job
5456
- attach_workspace:

.github/workflows/ToolboxDistribution.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Compile, Test and Release toolbox
33
on:
44
push:
55
branches: [ main ]
6+
tags:
7+
- 'v*'
68
pull_request:
79
branches: [ main ]
810

@@ -77,7 +79,8 @@ jobs:
7779

7880
# The packaged toolbox is distributed as a GitHub release
7981
- name: Create release and upload asset
82+
if: startsWith(github.ref, 'refs/tags/')
8083
run: |
81-
gh release create ${{github.run_id}} --title "Cross-Platform Array Product Toolbox" toolbox.mltbx
84+
gh release create gh-${{github.ref_name}} --title "Cross-Platform Array Product Toolbox" toolbox.mltbx
8285
env:
8386
GH_TOKEN: ${{ github.token }}

AzureDevOps/ToolboxDistribution.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
trigger:
2+
branches:
3+
include:
4+
- main
5+
tags:
6+
include:
7+
- 'v*'
8+
9+
pr:
10+
branches:
11+
include:
12+
- main
13+
114
jobs:
215
# This job compiles MEX files and runs tests across different platforms
316
- job: CompileAndTestMex
@@ -62,10 +75,11 @@ jobs:
6275

6376
# The packaged toolbox is distributed as a GitHub release
6477
- task: GitHubRelease@1
78+
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
6579
inputs:
6680
gitHubConnection: advanced-ci-configuration-examples
6781
title: "Cross-Platform Array Product Toolbox"
6882
assets: 'toolbox.mltbx'
6983
tagSource: 'userSpecifiedTag'
70-
tag: '$(Build.BuildNumber)'
84+
tag: 'azure-$(Build.SourceBranchName)'
7185
dependsOn: CompileAndTestMex

0 commit comments

Comments
 (0)