Reusable workflows for use with your plugin's CI-CD workflow.
This shows how to call and use a reusable workflow.
Below we're calling the reusable workflow "GetCSProjVersion" which extracts version details from a csproj file and returns a semver version string.
After we're using the value returned by the reusable workflow to verify it worked correctly.
name: Manual Workflowon:
workflow_dispatch:
inputs:
release-type-tag: # Use -alpha, -beta, or -rc for pre-release. An empty string for stable.description: 'Release type tag'required: truedefault: ''type: choiceoptions:
- '-alpha'
- '-beta'
- '-RC'
- ''jobs:
GetCSProjVersion:
name: Get C# project versionuses: SpeedRunTool/Workflows/.github/workflows/GetCSProjVersion.yml@mainwith:
repository: ${{ github.GITHUB_REPOSITORY }}ref: ${{ github.GITHUB_REF_NAME }}config-path: src/SampleProject/SampleProject.csprojrelease-type-tag: ${{ inputs.release-type-tag }}GetUTCDateTime:
name: Get UTC DateTimeuses: SpeedRunTool/Workflows/.github/workflows/GetUTCDateTime.yml@mainReport:
name: Report valuesruns-on: ubuntu-latestneeds: [GetCSProjVersion, GetUTCDateTime]steps:
- name: Report Versionrun: echo ${{ needs.GetCSProjVersion.outputs.version }}
- name: Report UTC DateTimerun: echo ${{ needs.GetUTCDateTime.outputs.utc-datetime }}