Skip to content

Release (R2023b)

Release (R2023b) #15

# This workflow was automatically generated by `make_release_workflow.py`.
#
# Do not edit it directly! Instead edit the template `release-template.yml.jinja`
# and re-generate the workflows using `make_release_workflow.py`.
name: Release (R2023b)
description: Compile, Build, Publish on PyPI, Release on GitHub
on:
workflow_run:
workflows: [Release]
types:
- completed
workflow_dispatch:
inputs:
spm-version:
description: 'SPM Commit / Branch / Tag / SHA to checkout'
required: false
default: ''
# ======================================================================
jobs:
# --------------------------------------------------------------------
spm-version:
outputs:
value: ${{ join(steps.*.outputs.value, '') }}
runs-on: ubuntu-latest
steps:
- id: if-run
if: ${{ github.event.workflow_run.conclusion == 'success' }}
run: |
echo "$SPM_VERSION"
echo "value=$SPM_VERSION" >> "$GITHUB_OUTPUT"
env:
SPM_VERSION: ${{ github.event.workflow_run.name }}
- id: if-dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "$SPM_VERSION"
echo "value=$SPM_VERSION" >> "$GITHUB_OUTPUT"
env:
SPM_VERSION: ${{ inputs.spm-version }}
print-spm-version:
needs: spm-version
runs-on: ubuntu-latest
steps:
- name: "spm-version: ${{ needs.spm-version.outputs.value }}"
run: true
# --------------------------------------------------------------------
guess-version:
needs: spm-version
uses: ./.github/workflows/guess_version.yml
with:
spm-version: ${{ needs.spm-version.outputs.value }}
increase-post: false
# --------------------------------------------------------------------
compile:
needs: [guess-version, spm-version]
uses: ./.github/workflows/compile.yml
with:
spm-version: ${{ needs.spm-version.outputs.value }}
matlab-version: R2023b
secrets:
MATLAB_BATCH_TOKEN: ${{ secrets.MATLAB_BATCH_TOKEN }}
# --------------------------------------------------------------------
build:
needs: [compile, spm-version]
uses: ./.github/workflows/build.yml
with:
spm-version: ${{ needs.spm-version.outputs.value }}
matlab-version: R2023b
main-package: false
# --------------------------------------------------------------------
publish-test-pypi:
needs: [build, spm-version]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/spm-runtime-R2023b
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download distribution
uses: actions/download-artifact@v4
env:
SPM_VERSION: ${{ needs.spm-version.outputs.value }}
MATLAB_VERSION: R2023b
with:
name: spm_${{ env.SPM_VERSION }}_${{ env.MATLAB_VERSION }}.dist
path: dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# --------------------------------------------------------------------
publish-pypi:
needs: [publish-test-pypi, spm-version]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/spm-runtime-R2023b
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download distribution
uses: actions/download-artifact@v4
env:
SPM_VERSION: ${{ needs.spm-version.outputs.value }}
MATLAB_VERSION: R2023b
with:
name: spm_${{ env.SPM_VERSION }}_${{ env.MATLAB_VERSION }}.dist
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1