Skip to content

Create Quantic Package #892

Create Quantic Package

Create Quantic Package #892

name: Create Quantic Package
on:
workflow_dispatch:
schedule:
- cron: '0 22 * * *'
defaults:
run:
shell: bash
jobs:
create-and-promote-quantic-package:
name: Create Quantic Package
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check Out Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
with:
node-version-file: '.nvmrc'
- name: Create cache file
run: |
mkdir check-SHA
echo ${{ github.sha }} > github-sha.txt
- name: Check SHA
id: check_sha
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: check-SHA
key: check-SHA-${{ github.sha }}
- name: Cancel current workflow run if no changes made
if: steps.check_sha.outputs.cache-hit == 'true'
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
with:
script: |
github.rest.actions.cancelWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId
})
- name: Setup
uses: ./.github/actions/build
- name: Create package version
working-directory: ./packages/quantic
run: |
echo "${{ secrets.SFDX_AUTH_PACKAGE_JWT_KEY }}" > server.key
npx --no-install ts-node scripts/build/create-package.ts --remove-translations --ci
rm server.key
env:
SFDX_AUTH_JWT_USERNAME: [email protected]
SFDX_AUTH_JWT_KEY: server.key
SFDX_AUTH_CLIENT_ID: ${{ secrets.SFDX_AUTH_PACKAGE_CLIENT_ID }}
report-status:
needs: [create-and-promote-quantic-package]
if: failure() || success()
name: Report Status
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- run: |
url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
if [[ ${{ contains(needs.*.result, 'failure') }} == "false" ]]; then
message="🟢 Create Quantic Package build run success"
else
message="🔴 Create Quantic Package build run failure"
fi
curl -X POST -H "Content-Type: application/json" -d "{\"message\": \"$message\", \"url\": \"$url\"}" ${{ secrets.SLACK_WEBHOOK_CREATE_QUANTIC_PACKAGE }}