Skip to content

chore(release): Publish monorepo release updates #4

chore(release): Publish monorepo release updates

chore(release): Publish monorepo release updates #4

Workflow file for this run

# Note: this is a shared pipeline used by other repositories.
# Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows
name: "Continuous Integration"
on:
workflow_call:
inputs:
tag:
description: Override release tag
type: string
required: false
stormBot:
description: The github username of the Storm bot
required: false
type: string
default: "Stormie-Bot"
secrets:
githubToken:
required: true
npmToken:
required: true
cargoToken:
required: true
slackToken:
required: true
discordWebhook:
required: true
jobs:
ci:
name: "Continuous Integration"
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
if: startsWith(github.repository, 'storm-software/') && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
steps:
- name: Send Slack notification - Deployment started
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: "notifications"
payload: |
{
"text": "Deployment for ${{ github.repository }} has started (In Progress)",
"attachments": [
{
"pretext": "Deployment for ${{ github.repository }} has started",
"color": "1fb2a6",
"fields": [
{
"title": "Status",
"short": true,
"value": "In Progress"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.slackToken }}
- name: Send Discord notification - Deployment started
uses: Ilshidur/action-discord@master
with:
args: "Deployment for ${{ github.repository }} has started - #${{ github.run_number }}"
env:
DISCORD_WEBHOOK: ${{ secrets.discordWebhook }}
DISCORD_USERNAME: ${{ inputs.stormBot }}
DISCORD_AVATAR: "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-stormie.png"
DISCORD_EMBEDS: '[{"title": "Deployment #${{ github.run_number }} has started", "description": "Deployment for ${{ github.repository }} is currently in process - #${{ github.run_number }}", "thumbnail": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" }, "image": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-fill.png" }, "author": { "name": "${{ github.actor }}", "url": "https://github.com/${{ github.actor }}", "icon_url": "https://avatars.githubusercontent.com/u/${{ github.actor_id }}?v=4" }, "fields": [ { "name": "Repository", "value": "${{ github.repository }}" }, { "name": "Repository URL", "value": "${{ github.repositoryUrl }}" }, { "name": "Pipeline Status", "value": "In Progress" }], "color": 2077350, "timestamp": "${{ github.event.repository.updated_at }}", "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}", "footer": { "text": "Click here to see the full workflow details: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}", "icon_url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" } }]'
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.githubToken }}
- name: Setup workspace
uses: storm-software/storm-ops/.github/actions/setup
with:
packageManager: pnpm
packageManagerVersion: 8.10.2
stormBot: ${{ inputs.stormBot }}
- name: Configure git
run: |
git config user.name "${{ inputs.stormBot }}"
git config user.email "${{ inputs.stormBot }}@users.noreply.github.com"
git config lfs.allowincompletepush true
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
shell: bash
- name: Get appropriate base and head commits for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: "main"
- name: Set appropriate base and head commits for `nx affected` commands
run: |
echo "BASE: ${{ env.NX_BASE }}"
echo "HEAD: ${{ env.NX_HEAD }}"
shell: bash
- name: Run build script
run: pnpm build-all
shell: bash
- name: Run linters scripts
run: pnpm lint
shell: bash
- name: Super-linter
uses: super-linter/super-linter@v6.4.1
env:
GITHUB_TOKEN: ${{ secrets.githubToken }}
- name: Markdown-linter
uses: DavidAnson/markdownlint-cli2-action@v9
- name: Run formatters scripts
run: pnpm nx format
shell: bash
- name: Re-run build script
run: pnpm build-all
shell: bash
- name: Release repository updates
run: pnpm release --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.npmToken }}
CARGO_REGISTRY_TOKEN: ${{ secrets.cargoToken }}
STORM_BOT: ${{ inputs.stormBot }}
STORM_WORKSPACE_ROOT: ${{ github.workspace }}
STORM_REPOSITORY: ${{ github.repositoryUrl }}
TAG: ${{ inputs.tag }}
success:
needs:
- ci
if: ${{ success() }}
name: Send success notification
runs-on: ubuntu-latest
steps:
- name: Send Slack notification - Deployment successful
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: "notifications"
update-ts: ${{ steps.ci.outputs.ts }}
payload: |
{
"text": "Deployment for ${{ github.repository }} has finished (Completed) \n\nPipeline Status: Success \nClick here to see the full workflow details: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"attachments": [
{
"pretext": "Deployment for ${{ github.repository }} has finished successfully",
"color": "087f5b",
"fields": [
{
"title": "Status",
"short": true,
"value": "Completed"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.slackToken }}
- name: Send Discord notification - Deployment successful
uses: Ilshidur/action-discord@master
with:
args: "Deployment for ${{ github.repository }} finished successfully - #${{ github.run_number }}"
env:
DISCORD_WEBHOOK: ${{ secrets.discordWebhook }}
DISCORD_USERNAME: ${{ inputs.stormBot }}
DISCORD_AVATAR: "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-stormie.png"
DISCORD_EMBEDS: '[{"title": "Deployment #${{ github.run_number }} was successful!", "description": "Deployment for ${{ github.repository }} has finished successfully - #${{ github.run_number }}", "thumbnail": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" }, "image": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-fill.png" }, "author": { "name": "${{ github.actor }}", "url": "https://github.com/${{ github.actor }}", "icon_url": "https://avatars.githubusercontent.com/u/${{ github.actor_id }}?v=4" }, "fields": [ { "name": "Repository", "value": "${{ github.repository }}" }, { "name": "Repository URL", "value": "${{ github.repositoryUrl }}" }, { "name": "Pipeline Status", "value": "Success" }], "color": 556891, "timestamp": "${{ github.event.repository.updated_at }}", "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}", "footer": { "text": "Click here to see the full workflow details: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}", "icon_url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" }}]'
failure:
needs:
- ci
if: ${{ failure() }}
name: Send failure notification
runs-on: ubuntu-latest
steps:
- name: Send Slack notification - Deployment failed
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: "notifications"
update-ts: ${{ steps.ci.outputs.ts }}
payload: |
{
"text": "Deployment for ${{ github.repository }} has finished (Failure) \n\nPipeline Status: Failure\nError: ${{ job.conclusion }}\nReason: ${{ job.cancelled }}\nConclusion: ${{ job.conclusion }}\nOutput: ${{ job.output }}\nLogs: ${{ job.logs }} \nSteps: ${{ job.steps }} \nActions: ${{ job.actions }} \nServices: ${{ job.services }} \nEnvironment: ${{ job.environment}} \nClick here to see the full workflow details: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"attachments": [
{
"pretext": "Deployment for ${{ github.repository }} has finished with failures",
"color": "990000",
"fields": [
{
"title": "Status",
"short": true,
"value": "Failure"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.slackToken }}
- name: Send Discord notification - Deployment failed
uses: Ilshidur/action-discord@master
with:
args: "Deployment for ${{ github.repository }} finished with failures - #${{ github.run_number }}"
env:
DISCORD_WEBHOOK: ${{ secrets.discordWebhook }}
DISCORD_USERNAME: ${{ inputs.stormBot }}
DISCORD_AVATAR: "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-stormie.png"
DISCORD_EMBEDS: '[{"title": "Deployment #${{ github.run_number }} has failed", "description": "Deployment for ${{ github.repository }} finished with failures - #${{ github.run_number }}", "thumbnail": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" }, "image": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-fill.png" }, "author": { "name": "${{ github.actor }}", "url": "https://github.com/${{ github.actor }}", "icon_url": "https://avatars.githubusercontent.com/u/${{ github.actor_id }}?v=4" }, "fields": [ { "name": "Repository", "value": "${{ github.repository }}" }, { "name": "Repository URL", "value": "${{ github.repositoryUrl }}" }, { "name": "Pipeline Status", "value": "Failure" }, { "name": "Event", "value": "${{ github.event_name }}" }, { "name": "Result", "value": "${{ steps.ci.result }}" }, { "name": "Conclusion", "value": "${{ steps.ci.conclusion }}" }, { "name": "Output", "value": "${{ toJSON(steps.ci.outputs) }}" }], "color": 10027008, "timestamp": "${{ github.event.repository.updated_at }}", "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}", "footer": { "text": "Click here to see the full workflow details: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}", "icon_url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" } }]'
cancelled:
needs:
- ci
if: ${{ cancelled() }}
name: Send cancelled notification
runs-on: ubuntu-latest
steps:
- name: Send Slack notification - Deployment cancelled
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: "notifications"
update-ts: ${{ steps.ci.outputs.ts }}
payload: |
{
"text": "Deployment for ${{ github.repository }} has finished (Cancelled) \n\nPipeline Status: Cancelled\nError: ${{ job.conclusion }}\nReason: ${{ job.cancelled }}\nConclusion: ${{ job.conclusion }}\nOutput: ${{ job.output }}\nLogs: ${{ job.logs }} \nSteps: ${{ job.steps }} \nActions: ${{ job.actions }} \nServices: ${{ job.services }} \nEnvironment: ${{ job.environment}} \nClick here to see the full workflow details: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"attachments": [
{
"pretext": "Deployment for ${{ github.repository }} has been cancelled",
"color": "990000",
"fields": [
{
"title": "Status",
"short": true,
"value": "Cancelled"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.slackToken }}
- name: Send Discord notification - Deployment cancelled
uses: Ilshidur/action-discord@master
with:
args: "Deployment for ${{ github.repository }} has been cancelled - #${{ github.run_number }}"
env:
DISCORD_WEBHOOK: ${{ secrets.discordWebhook }}
DISCORD_USERNAME: ${{ inputs.stormBot }}
DISCORD_AVATAR: "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-stormie.png"
DISCORD_EMBEDS: '[{"title": "Deployment #${{ github.run_number }} was cancelled", "description": "Deployment for ${{ github.repository }} was cancelled before it could complete normal execution - #${{ github.run_number }}", "thumbnail": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" }, "image": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-fill.png" }, "author": { "name": "${{ github.actor }}", "url": "https://github.com/${{ github.actor }}", "icon_url": "https://avatars.githubusercontent.com/u/${{ github.actor_id }}?v=4" }, "fields": [ { "name": "Repository", "value": "${{ github.repository }}" }, { "name": "Repository URL", "value": "${{ github.repositoryUrl }}" }, { "name": "Pipeline Status", "value": "Cancelled" }, { "name": "Event", "value": "${{ github.event_name }}" }, { "name": "Result", "value": "${{ steps.ci.result }}" }, { "name": "Conclusion", "value": "${{ steps.ci.conclusion }}" }, { "name": "Output", "value": "${{ toJSON(steps.ci.outputs) }}" }], "color": 16565273, "timestamp": "${{ github.event.repository.updated_at }}", "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}", "footer": { "text": "Click here to see the full workflow details: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}", "icon_url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" } }]'