Skip to content

Commit

Permalink
Update cicd_manual_publish-sdk.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dcolina authored Oct 11, 2024
1 parent ea0839c commit a17fc51
Showing 1 changed file with 58 additions and 38 deletions.
96 changes: 58 additions & 38 deletions .github/workflows/cicd_manual_publish-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,68 @@ name: Tester

on:
workflow_dispatch:
# inputs:
# release_version:
# description: 'Release Version (yy.mm.dd[_lts_v##]])'
# required: true
inputs:
release_version:
description: 'Release Version (yy.mm.dd[_lts_v##]])'
required: true

jobs:
# generate-sbom:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/legacy-release/sbom-generator
# with:
# dotcms_version: ${{ inputs.release_version }}
# github_token: ${{ secrets.GITHUB_TOKEN }}


deployment:
generate-sbom:
runs-on: ubuntu-22.04
# Use of Docker environments to enable per-deployment environment secrets
# This allows for different secrets to be used based on the deployment environment
environment: trunk
steps:
# Checkout the repository
- uses: actions/checkout@v4
# Clean up the runner to ensure a fresh environment
# - uses: ./.github/actions/core-cicd/cleanup-runner

- name: SDKs Publish
id: sdks_publish
uses: ./.github/actions/core-cicd/deployment/deploy-javascript-sdk
- uses: ./.github/actions/legacy-release/sbom-generator
with:
ref: master
github-token: ${{ secrets.GITHUB_TOKEN }}
npm-token: ${{ secrets.NPM_TEST_TOKEN }}
# Send Slack notification for SDK publication
- name: Slack Notification (SDK announcement)
if: success() && steps.sdks_publish.outputs.published == 'true'
uses: ./.github/actions/core-cicd/notification/notify-slack
dotcms_version: ${{ inputs.release_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 'Download all build artifacts'
uses: actions/download-artifact@v4
with:
channel-id: "slack-notification-testing"
payload: |
> :large_orange_circle: *Attention dotters:* SDK libs (Angular, Client, Experiments and React) published!
>
> This automated script is happy to announce that a new *_SDK libs_* version *tagged as:* [ `${{ steps.sdks_publish.outputs.npm-package-version }}` ] is now available on the `NPM` registry :package:!
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
path: ${{ github.workspace }}/artifacts
pattern: ${{ steps.sbom-generator.outputs.sbom-artifact }}

- name: Upload SBOM Asset
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
SBOM_ARTIFACT=${{ steps.sbom-generator.outputs.sbom-artifact }}
if [ -f "${SBOM_ARTIFACT}.json" ]; then
echo "SBOM: ${SBOM_ARTIFACT}"
# zip ${SBOM_ARTIFACT}.zip ./artifacts/${{ steps.sbom-generator.outputs.sbom-artifact }}.json
# gh release upload "${{ needs.prepare-release.outputs.release_tag }}" "./artifacts/${{ steps.sbom-generator.outputs.sbom-artifact }}.zip"
else
echo "SBOM artifact not found."
fi

# deployment:
# runs-on: ubuntu-22.04
# # Use of Docker environments to enable per-deployment environment secrets
# # This allows for different secrets to be used based on the deployment environment
# environment: trunk
# steps:
# # Checkout the repository
# - uses: actions/checkout@v4
# # Clean up the runner to ensure a fresh environment
# # - uses: ./.github/actions/core-cicd/cleanup-runner

# - name: SDKs Publish
# id: sdks_publish
# uses: ./.github/actions/core-cicd/deployment/deploy-javascript-sdk
# with:
# ref: master
# github-token: ${{ secrets.GITHUB_TOKEN }}
# npm-token: ${{ secrets.NPM_TEST_TOKEN }}
# # Send Slack notification for SDK publication
# - name: Slack Notification (SDK announcement)
# if: success() && steps.sdks_publish.outputs.published == 'true'
# uses: ./.github/actions/core-cicd/notification/notify-slack
# with:
# channel-id: "slack-notification-testing"
# payload: |
# > :large_orange_circle: *Attention dotters:* SDK libs (Angular, Client, Experiments and React) published!
# >
# > This automated script is happy to announce that a new *_SDK libs_* version *tagged as:* [ `${{ steps.sdks_publish.outputs.npm-package-version }}` ] is now available on the `NPM` registry :package:!
# slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit a17fc51

Please sign in to comment.