Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plock fix v2 #4503

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/actions/confirm-build-ok/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Confirm build is valid'
description: 'Confirm build is valid'
inputs:
github-token:
description: The GitHub token
required: true
conclusion:
description: The conclusion of the check. failure or success
required: true
runs:
using: composite
steps:
- name: Add GitHub check
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
github-token: ${{ inputs.github-token }}
script: |
const conclusion = '${{ inputs.conclusion }}'; // Get the conclusion input
const commitSha =
context.eventName === 'pull_request' ?
context.payload.pull_request.head.sha
: context.eventName === 'merge_group' ?
context.payload.merge_group.head_sha
: context.sha;

const restOptions = {
owner: context.repo.owner,
repo: context.repo.repo,
sha: commitSha,
state: conclusion, // Use the conclusion input
description: `Build is a ${conclusion}`,
context: 'probot/conclusion',
};

github.rest.repos.createCommitStatus(restOptions)
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Dependency Review'

on:
pull_request:
branches: ['master']
branches: ['v2']

permissions:
contents: read
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/masterbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Master Robot
on:
push:
branches:
- master
- 'prerelease/**'
- v2
jobs:
build:
name: 'Build'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package-lock-root-fail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: 'package-lock.json root validator'

on:
push:
branches: [master]
branches: [v2]
paths:
- '**/package-lock.json'
- '!utils/atomic-storybook/package-lock.json'
- '!package-lock.json'
pull_request:
branches: [master]
branches: [v2]
paths:
- '**/package-lock.json'
- '!utils/atomic-storybook/package-lock.json'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package-lock-root-success.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: 'package-lock.json root validator'

on:
push:
branches: [master]
branches: [v2]
paths-ignore:
- '**/package-lock.json'
- '!package-lock.json'
pull_request:
branches: [master]
branches: [v2]
paths-ignore:
- '**/package-lock.json'
- '!package-lock.json'
Expand Down
47 changes: 20 additions & 27 deletions .github/workflows/prbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,20 @@ jobs:
- 'e2e-headless-ssr-test-pages-prod'
runs-on: ubuntu-latest
steps:
- run: |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Determine conclusion
run: |
success="${{ !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure')}}"
if [[ $success == "true" ]]; then
echo "Build is valid"
exit 0
echo "conclusion=success" >> "$GITHUB_OUTPUT"
else
echo "Build is invalid"
exit 1
echo "conclusion=failure" >> "$GITHUB_OUTPUT"
fi
id: determine-conclusion
- uses: ./.github/actions/confirm-build-ok
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ steps.determine-conclusion.outputs.conclusion }}
is-valid-merge-queue:
name: 'Confirm build is valid (merge group)'
if: ${{ always() && github.event_name == 'merge_group'}}
Expand All @@ -386,29 +391,17 @@ jobs:
- 'e2e-headless-ssr-test-pages-prod'
runs-on: ubuntu-latest
steps:
- run: |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Determine conclusion
run: |
success="${{ !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure')}}"
if [[ $success == "true" ]]; then
echo "Build is valid"
exit 0
else
echo "Build is invalid"
exit 1
fi
is-valid:
name: 'Confirm build is valid'
if: ${{ always() }}
needs:
- 'is-valid-pr'
- 'is-valid-merge-queue'
runs-on: ubuntu-latest
steps:
- run: |
success="${{ contains(needs.*.result, 'success')}}"
if [[ $success == "true" ]]; then
echo "Build is valid"
exit 0
echo "conclusion=success" >> "$GITHUB_OUTPUT"
else
echo "Build is invalid"
exit 1
echo "conclusion=failure" >> "$GITHUB_OUTPUT"
fi
id: determine-conclusion
- uses: ./.github/actions/confirm-build-ok
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ steps.determine-conclusion.outputs.conclusion }}
53 changes: 27 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,32 +73,33 @@ jobs:
run: npm run notify:docs
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
quantic-prod:
needs: release
runs-on: ubuntu-latest
environment: 'Quantic Production'
permissions:
contents: read
packages: write
discussions: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: 'release/v2'
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- name: Promote SFDX package to production
run: |
echo "${{ secrets.SFDX_AUTH_JWT_KEY }}" > ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
npx --no-install nx run quantic:"promote:sfdx:ci"
rm ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
env:
SFDX_AUTH_CLIENT_ID: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
SFDX_AUTH_JWT_KEY: ${{ secrets.SFDX_AUTH_JWT_KEY }}
SFDX_AUTH_JWT_USERNAME: ${{ vars.SFDX_AUTH_JWT_USERNAME }}
SFDX_AUTH_JWT_KEY_FILE: ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./packages/quantic
# TODO SFINT-5697
# quantic-prod:
# needs: release
# runs-on: ubuntu-latest
# environment: 'Quantic Production'
# permissions:
# contents: read
# packages: write
# discussions: write
# steps:
# - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
# with:
# ref: 'release/v2'
# - uses: ./.github/actions/setup
# - uses: ./.github/actions/setup-sfdx
# - name: Promote SFDX package to production
# run: |
# echo "${{ secrets.SFDX_AUTH_JWT_KEY }}" > ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
# npx --no-install nx run quantic:"promote:sfdx:ci"
# rm ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
# env:
# SFDX_AUTH_CLIENT_ID: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
# SFDX_AUTH_JWT_KEY: ${{ secrets.SFDX_AUTH_JWT_KEY }}
# SFDX_AUTH_JWT_USERNAME: ${{ vars.SFDX_AUTH_JWT_USERNAME }}
# SFDX_AUTH_JWT_KEY_FILE: ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# working-directory: ./packages/quantic

# TODO KIT-3074 Fix the publication into the GitHub Packages, and uncomment
# github-prod:
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
]
}
},
"defaultBase": "master",
"defaultBase": "v2",
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"useInferencePlugins": false
}
Loading
Loading