Skip to content

Commit

Permalink
prep for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbuzinski committed Jan 23, 2024
1 parent c37c6ca commit 9c2dc68
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 35 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build and Test
on: [push]

jobs:
bat:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Perform npm tasks
run: npm run ci
- uses: actions/upload-artifact@v3
with:
name: built-action
path: |
**/*
!node_modules/
integ:
needs: bat
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
release: latest
products: Simulink Simulink_Test
check-matlab: matlabVer = ver('matlab'); assert(~isempty(matlabVer));
check-simulink: simulinkVer = ver('simulink'); assert(~isempty(simulinkVer));
- os: ubuntu-20.04
release: R2021bU2
products: |
MATLAB
Simulink
check-matlab: matlabVer = ver('matlab'); assert(strcmp(matlabVer.Release,'(R2021b)'));
check-simulink: simulinkVer = ver('simulink'); assert(strcmp(simulinkVer.Release,'(R2021b)'));
- os: windows-latest
release: latest
products: Simulink
check-matlab: matlabVer = ver('matlab'); assert(~isempty(matlabVer));
check-simulink: simulinkVer = ver('simulink'); assert(~isempty(simulinkVer));
- os: macos-latest
release: latest
products: Simulink
check-matlab: matlabVer = ver('matlab'); assert(~isempty(matlabVer));
check-simulink: simulinkVer = ver('simulink'); assert(~isempty(simulinkVer));
steps:
- uses: actions/download-artifact@v3
with:
name: built-action
- name: Install selected products
id: setup_matlab
uses: ./
with:
release: ${{ matrix.release }}
products: ${{ matrix.products }}
- name: Check matlabroot output is set
run: 'if [[ "${{ steps.setup_matlab.outputs.matlabroot }}" != *"MATLAB"* ]]; then exit 1; fi'
shell: bash
- name: Check MATLAB version
uses: matlab-actions/run-command@v2
with:
command: "${{ matrix.check-matlab }}"
- name: Check Simulink version
uses: matlab-actions/run-command@v2
with:
command: "${{ matrix.check-simulink }}"
- name: Check NoOp on 2nd install
uses: ./
with:
release: ${{ matrix.release }}
products: ${{ matrix.products }}

80 changes: 80 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Publish

on:
release:
types: [published, edited]

jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.update-package-version.outputs.version }}
steps:
# Configure runner with the right stuff
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure git
run: |
git config user.name 'Release Action'
git config user.email '<>'
- uses: actions/setup-node@v3
with:
node-version: 16

# Call `npm version`. It increments the version and commits the changes.
# We'll save the output (new version string) for use in the following
# steps
- name: Update package version
id: update-package-version
run: |
git tag -d "${{ github.event.release.tag_name }}"
VERSION=$(npm version "${{ github.event.release.tag_name }}" --no-git-tag-version)
echo "::set-output name=version::$VERSION"
git add package.json package-lock.json
git commit -m "[skip ci] Bump $VERSION"
git push origin HEAD:main
# Now carry on, business as usual
- name: Perform npm tasks
run: npm run ci

# Finally, create a detached commit containing the built artifacts and tag
# it with the release. Note: the fact that the branch is locally updated
# will not be relayed (pushed) to origin
- name: Commit to release branch
id: release_info
run: |
# Check for semantic versioning
echo "Preparing release for version $longVersion"
longVersion="${{github.event.release.tag_name}}"
[[ $longVersion == v[0-9]*.[0-9]*.[0-9]* ]] || (echo "must follow semantic versioning" && exit 1)
majorVersion=$(echo ${longVersion%.*.*})
minorVersion=$(echo ${longVersion%.*})
# Add the built artifacts. Using --force because dist should be in
# .gitignore
git add --force dist
# Make the commit
MESSAGE="Build for $(git rev-parse --short HEAD)"
git commit --allow-empty -m "$MESSAGE"
git tag -f -a -m "Release $longVersion" $longVersion
# Get the commit of the tag you just released
commitHash=$(git rev-list -n 1 $longVersion)
# Delete the old major and minor version tags locally
git tag -d $majorVersion || true
git tag -d $minorVersion || true
# Make new major and minor version tags locally that point to the commit you got from the "git rev-list" above
git tag -f $majorVersion $commitHash
git tag -f $minorVersion $commitHash
# Force push the new minor version tag to overwrite the old tag remotely
echo "Pushing new tags"
git push -f origin $longVersion
git push -f origin $majorVersion
git push -f origin $minorVersion
17 changes: 0 additions & 17 deletions dist/cache-save/index.js

This file was deleted.

17 changes: 0 additions & 17 deletions dist/setup/index.js

This file was deleted.

1 change: 0 additions & 1 deletion src/properties.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"matlabBatchUrl": "https://ssd.mathworks.com/supportfiles/ci/matlab-batch/v0/install.sh",
"matlabDepsUrl": "https://ssd.mathworks.com/supportfiles/ci/matlab-deps/v0/install.sh",
"matlabLatestReleaseUrl": "https://ssd.mathworks.com/supportfiles/ci/matlab-release/v0/latest",
"matlabBatchRootUrl": "https://ssd.mathworks.com/supportfiles/ci/matlab-batch/v1/",
Expand Down

0 comments on commit 9c2dc68

Please sign in to comment.