ci: fix syntax #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Flxbl CI/CD Template for GitHub | |
#---------------------------------------------------------------------------------------------------- | |
# Follows reference pipeline available at docs.dxatscale.io | |
# | |
#----------------------------------------------------------------------------------------------------- | |
# To know more about Flxbl, visit https://docs.dxatscale.io | |
# To know more on sfp, visit https://docs.flxbl.io/sfp | |
# This workflow builds and publishes packages to artifact repository. | |
# Note that while using Hutte, new scratch orgs after this workflow will come with the newly published packages installed. | |
name: Build & Publish | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
# Set the environment variables for tracking metrics | |
#env: | |
# SFPOWERSCRIPTS_NEWRELIC: 'true' | |
# SFPOWERSCRIPTS_NEWRELIC_API_KEY: '${{ secrets.NEWRELIC_INSIGHT_INSERT_KEYS }}' | |
# SFPOWERSCRIPTS_DATADOG: 'true' | |
# SFPOWERSCRIPTS_DATADOG_HOST: '${{ secrets.DATADOG_HOST }}' | |
# SFPOWERSCRIPTS_DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}' | |
# SFPOWERSCRIPTS_SPLUNK: 'true' | |
# SFPOWERSCRIPTS_SPLUNK_HOST: '${{ secrets.SPLUNK_HOST }}' | |
# SFPOWERSCRIPTS_SPLUNK_API_KEY: '${{ secrets.SPLUNK_API_KEY }}' | |
jobs: | |
buildAndPublish: | |
name: Build and Publish | |
runs-on: ubuntu-latest | |
container: ghcr.io/flxbl-io/sfp | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Authenticate Dev Hub | |
run: | | |
echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile | |
sf org login sfdx-url -f authfile -a devhub | |
- name: Build packages | |
id: sfpowerscripts-build | |
run: | | |
# TODO: quickbuild used instead of build, to be fixed in dxatscale, at the moment source packages cannot have dependencies to other source packages | |
sfp quickbuild --devhubalias devhub --diffcheck --buildnumber ${GITHUB_RUN_ID} --branch ${GITHUB_REF#refs/heads/} --waittime 180 | |
# Publish artifacts | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: artifacts | |
# Authenticate to npm | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://npm.pkg.github.com" | |
- name: Publish | |
run: | | |
sfp publish --artifactdir artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |