Skip to content

fix: add @equinor/fusion-lint and chalk dependencies to package.json … #4580

fix: add @equinor/fusion-lint and chalk dependencies to package.json …

fix: add @equinor/fusion-lint and chalk dependencies to package.json … #4580

Workflow file for this run

name: Fusion Framework Pre-Release
on:
push:
branches:
- next
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write # Required for creating changesets branch and pushing changes
packages: write # Required for publishing to npm registry
id-token: write # Required for OIDC token generation
pull-requests: write # Required for changesets action to create PRs
jobs:
check-pre-release:
name: Check pre-release configuration
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.check.outputs.should-run }}
tag: ${{ steps.check.outputs.tag }}
steps:
- uses: actions/checkout@v7
- name: Check pre-release configuration
id: check
run: |
if [ ! -f ".changeset/pre.json" ]; then
echo "should-run=false" >> $GITHUB_OUTPUT
echo "::notice::Pre-release skipped: .changeset/pre.json not found, run 'pnpm changeset pre enter <tag>' to enable pre-release mode."
exit 0
fi
TAG=$(node -p "require('./.changeset/pre.json').tag")
if [ "$TAG" = "latest" ]; then
echo "Error: Pre-release workflow cannot use 'latest' tag. 'latest' is reserved for stable releases."
exit 1
fi
echo "should-run=true" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Using tag from pre.json: $TAG"
release-pkg:
name: Version or publish pre-release of packages
needs: check-pre-release
if: needs.check-pre-release.outputs.should-run == 'true'
runs-on: fusion-gh-runner-fusion-framework
outputs:
published: ${{ steps.changesets.outputs.published }}
has-changesets: ${{ steps.changesets.outputs.has-changesets }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
# fusion-gh-runner-fusion-framework's image doesn't ship gh (tracked with
# infra); install it until the runner image is patched.
- name: Setup fusion runner
continue-on-error: true
uses: ./.github/actions/setup-fusion-runner
- name: Configure git user (trigger actor)
uses: ./.github/actions/config-git-user
- name: Setup node and install deps
uses: ./.github/actions/node-setup
# pnpm 11 stopped expanding ${NPM_TOKEN}-style placeholders from a repo's
# .npmrc (GHSA-3qhv-2rgh-x77r), so auth has to be written via `pnpm config
# set` at runtime instead of relying on env-var substitution in .npmrc.
- name: Configure npm registry auth
shell: bash
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v2
with:
github-token: ${{ github.token }}
pr-title: '🤖 Bip Bop - Fusion Framework Pre-Release'
version-script: pnpm changeset:version
publish-script: pnpm publish -r --no-git-checks --report-summary --tag ${{ needs.check-pre-release.outputs.tag }}
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: convert Changeset PR to draft
if: steps.changesets.outputs.published == 'false' && steps.changesets.outputs['pr-number']
continue-on-error: true
run: gh pr ready ${{ steps.changesets.outputs['pr-number'] }} --undo
env:
GH_TOKEN: ${{ github.token }}
# Publish a branch-scoped documentation preview whenever a pre-release is published
documentation-preview:
name: Documentation preview
permissions:
contents: read # Required to read repository contents
pages: write # Required to deploy to GitHub Pages
id-token: write # Required for OIDC token generation
needs: release-pkg
if: needs.release-pkg.outputs.published == 'true'
uses: ./.github/workflows/generate-docs.yml
secrets: inherit