fix(dependency): fix incorrect dependency resolution by favouring lat… #219
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
# This pipeline builds the sfp cli plugin | |
# Needs following secrets | |
# NPM_TOKEN : Token to npm.js for dx@scale scope | |
# DOCKER_USERNAME : Token to username for ghcr.io for publishing docker | |
# DOCKER_SECRET: Password/Token for ghcr.io for publishing docker | |
# | |
# Needs the following env vars | |
# The repo name (for docker registry) has to be set in each job due to a limitiation with github actions | |
# as global vars (non secrets) cant be passed down to other jobs | |
name: 'Release' | |
on: | |
push: | |
branches: | |
- main | |
- feat/docker-test | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'decision records/**' | |
- 'demoreel/**' | |
- 'prerequisites/**' | |
workflow_dispatch: | |
# Merge to Develop, create builds | |
jobs: | |
release-please: | |
outputs: | |
continue: ${{ steps.release.outputs.releases_created }} | |
released_version: ${{ steps.release.outputs.major || steps.release.outputs.minor || steps.release.outputs.patch }} | |
permissions: | |
contents: write | |
packages: write | |
pull-requests: write | |
repository-projects: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
token: ${{ secrets.NPM_TOKEN }} | |
registry-url: 'https://registry.npmjs.org' | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.GHA_TOKEN }} | |
config-file: release-please-config.json | |
- run: | | |
npm i | |
npm run build | |
npm publish --tag next | |
name: Publish packages | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
if: ${{ steps.release.outputs.releases_created == 'true'}} | |
# On successfull creation of packages,(or even if lerna skips), create docker image | |
build-docker: | |
name: 'build docker image' | |
uses: ./.github/workflows/sfp-build-docker.yml | |
if: ${{ needs.release-please.outputs.continue == 'true' || github.event_name == 'workflow_dispatch' }} | |
with: | |
job-environment: 'build-docker' | |
suffix-tag: ${{ github.run_id }} | |
repo: 'flxbl-io' | |
image: 'sfp-rc' | |
secrets: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
needs: | |
- release-please | |
build-docker-lite: | |
name: 'build sfp lite docker image' | |
uses: ./.github/workflows/sfp-build-docker.yml | |
if: ${{ needs.release-please.outputs.continue == 'true' || github.event_name == 'workflow_dispatch' }} | |
with: | |
job-environment: 'build-docker' | |
suffix-tag: ${{ github.run_id }} | |
repo: 'flxbl-io' | |
dockerFileName: 'sfp-lite' | |
image: 'sfp-lite-rc' | |
secrets: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
needs: | |
- release-please | |
#Promotion Stages | |
sfp-beta: | |
name: 'sfp beta' | |
uses: ./.github/workflows/promotePackage.yml | |
if: ${{ needs.release-please.outputs.continue == 'true' || github.event_name == 'workflow_dispatch' }} | |
with: | |
version: 'beta' | |
pathToPackageJson: 'package.json' | |
environment: sfp-beta | |
secrets: | |
npm-token: ${{ secrets.NPM_TOKEN }} | |
needs: | |
- release-please | |
beta-docker: | |
name: 'promote docker to beta' | |
uses: ./.github/workflows/sfp-promote-docker.yml | |
with: | |
job-environment: 'sfp-beta-docker' | |
repo: 'flxbl-io' | |
new-tag: beta | |
image: 'sfp-lite-rc' | |
secrets: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
needs: [ build-docker ] | |
beta-docker-lite: | |
name: 'promote docker light to beta' | |
uses: ./.github/workflows/sfp-promote-docker.yml | |
with: | |
job-environment: 'sfp-beta-docker' | |
repo: 'flxbl-io' | |
new-tag: beta | |
image: 'sfp-rc' | |
secrets: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
needs: [ build-docker-lite ] | |
sfp-prod: | |
name: 'sfp prod' | |
uses: ./.github/workflows/promotePackage.yml | |
if: ${{ needs.release-please.outputs.continue == 'true' || github.event_name == 'workflow_dispatch' }} | |
with: | |
version: 'latest' | |
pathToPackageJson: 'package.json' | |
environment: sfp-prod | |
secrets: | |
npm-token: ${{ secrets.NPM_TOKEN }} | |
needs: | |
- release-please | |
prod-docker: | |
name: 'copy rc docker to prod' | |
uses: ./.github/workflows/sfp-copy-docker.yml | |
with: | |
job-environment: 'sfp-prod-docker' | |
secrets: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
signing_secret: ${{ secrets.SIGNING_SECRET }} | |
cosign_password: ${{ secrets.COSIGN_PASSWORD }} | |
needs: [ build-docker ] | |
prod-docker-lite: | |
name: 'copy rc lite docker to prod' | |
uses: ./.github/workflows/sfp-copy-docker.yml | |
with: | |
job-environment: 'sfp-prod-docker' | |
image: sfp-lite-rc | |
image-as: sfp-lite | |
secrets: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
signing_secret: ${{ secrets.SIGNING_SECRET }} | |
cosign_password: ${{ secrets.COSIGN_PASSWORD }} | |
needs: [ build-docker-lite ] | |