Skip to content

Velaptor Preview Release (Dry Run) #64

Velaptor Preview Release (Dry Run)

Velaptor Preview Release (Dry Run) #64

Workflow file for this run

name: 🚀Release
run-name: ${{ vars.PROJECT_NAME }} ${{ inputs.release-type }} Release ${{ inputs.dry-run == true && '(Dry Run)' || '' }}
defaults:
run:
shell: pwsh
on:
workflow_dispatch:
inputs:
release-type:
description: The type of release. Choose 'Preview' or 'Production'.
required: true
type: choice
options: [Preview, Production]
trigger-api-docs-release:
description: Check to trigger a release of the API Documentation website.
required: false
default: true
type: boolean
dry-run:
description: Dry Run - Check to run the workflow without creating a release.
required: false
default: false
type: boolean
jobs:
determine_release_notes_path:
name: Determine Release Notes Dir Path
runs-on: ubuntu-latest
outputs:
release-notes-dir-path: ${{ steps.get-dir-path.outputs.release-notes-dir-path }}
steps:
- name: Get Dir Path
id: get-dir-path
run: |
$dirPath = "${{ inputs.release-type }}" -eq "Production" ? "${{ vars.PROD_RELATIVE_RELEASE_NOTES_DIR_PATH }}" : "${{ vars.PREV_RELATIVE_RELEASE_NOTES_DIR_PATH }}";
"release-notes-dir-path=$dirPath" >> $env:GITHUB_OUTPUT;
run_release:
name: Performing ${{ inputs.release-type }} Release of ${{ vars.PROJECT_NAME }} (${{ inputs.release-type == 'Production' && 'Release' || 'Debug' }})
needs: determine_release_notes_path
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected]
with:
project-name: "${{ vars.PROJECT_NAME}}"
release-type: "${{ inputs.release-type }}"
run-branch: "${{ github.ref_name }}"
net-sdk-version: "${{ vars.NET_SDK_VERSION }}"
relative-release-notes-dir-path: "${{ needs.determine_release_notes_path.outputs.release-notes-dir-path }}"
release-notes-file-name-prefix: "${{ vars.RELEASE_NOTES_FILE_NAME_PREFIX }}"
build-config: ${{ inputs.release-type == 'Production' && 'Release' || 'Debug' }}
pr-include-notes-label: "${{ vars.PR_INCLUDE_NOTES_LABEL }}"
send-release-tweet: ${{ vars.TWITTER_BROADCAST_ENABLED == 'true' }}
dry-run: ${{ inputs.dry-run }}
transpile-readme: true
secrets:
cicd-pat: "${{ secrets.CICD_TOKEN }}"
nuget-org-api-key: "${{ secrets.NUGET_ORG_API_KEY }}"
twitter-consumer-api-key: "${{ secrets.TWITTER_CONSUMER_API_KEY }}"
twitter-consumer-api-secret: "${{ secrets.TWITTER_CONSUMER_API_SECRET }}"
twitter-access-token: "${{ secrets.TWITTER_ACCESS_TOKEN }}"
twitter-access-token-secret: "${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}"
validate_version:
name: Validate Version
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected]
with:
project-name: "${{ vars.PROJECT_NAME }}"
release-type: "${{ inputs.release-type }}"
secrets:
cicd-pat: "${{ secrets.CICD_TOKEN }}"
run_api_doc_release:
name: Run API Doc Release
needs: [run_release, validate_version]
if: ${{ inputs.trigger-api-docs-release == true }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Set Up Deno (${{ vars.DENO_VERSION }})
uses: denoland/setup-deno@v1
with:
deno-version: ${{ vars.DENO_VERSION }}
- name: Execute API Release Workflow
run: |
$scriptUrl = "${{ github.workspace }}/.github/cicd/scripts/trigger-api-docs-release.ts";
deno run `
--allow-net `
$scriptUrl `
"${{ vars.DOC_SITE_REPO_NAME }}" `
"${{ vars.DOC_SITE_RELEASE_BRANCH }}" `
"${{ vars.DOC_SITE_API_RELEASE_WORKFLOW_NAME }}" `
"[api-version,${{ needs.validate_version.outputs.version }}]" `
"${{ secrets.CICD_TOKEN }}";
$releasesUrl = "https://github.com/${{ vars.ORGANIZATION_NAME }}/${{ vars.DOC_SITE_REPO_NAME }}/actions/workflows/${{ vars.DOC_SITE_API_RELEASE_WORKFLOW_NAME }}";
$notice = "An API documentation release has been triggered for the '${{ vars.DOC_SITE_REPO_NAME }}' repository."
$notice = $notice + "`n`t${{ vars.DOC_SITE_REPO_NAME }} Releases: $releasesUrl";
Write-Host "::notice::$notice";