Skip to content
Draft
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
42 changes: 42 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,45 @@ jobs:
tools_directory: tools
secrets:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}

update-codemeta:
name: Update codemeta.json
needs: prepare-release
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
ref: main

- name: Determine version string
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=v${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi

- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2

- name: Update codemeta.json
uses: matlab-actions/run-command@v2
with:
command: addpath(genpath("tools")); updateCodeMetaFile("${{ steps.version.outputs.tag }}")

- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add codemeta.json
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Update codemeta.json for ${{ steps.version.outputs.tag }}"
git push
fi