-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from bnb-chain/fix/cicd
chore: Add code owners
- Loading branch information
Showing
7 changed files
with
179 additions
and
40 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @aiden-cao @wenty22 @Halibao-Lala @doge95 |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: sdk-cicd-by-comment | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
alpha-release: | ||
uses: ./.github/workflows/alpha.yaml | ||
secrets: inherit | ||
with: | ||
package-name: canonical-bridge-sdk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: widget-cicd-by-comment | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
alpha-release: | ||
uses: ./.github/workflows/alpha.yaml | ||
secrets: inherit | ||
with: | ||
package-name: canonical-bridge-widget |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: alpha-cicd-trigger-by-comment | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package-name: | ||
description: 'package name' | ||
type: string | ||
required: true | ||
default: '' | ||
|
||
jobs: | ||
pre-check: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'bnb-chain/canonical-bridge' && contains(github.event.comment.body, '/qa-deploy:${{inputs.package-name}}') | ||
outputs: | ||
codeowners: ${{ steps.codeowners.outputs.content }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Read codeowners | ||
id: codeowners | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
path: .github/CODEOWNERS | ||
|
||
cicd: | ||
needs: [pre-check] | ||
if: contains(needs.pre-check.outputs.codeowners, github.event.comment.user.login) | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v3 | ||
id: get-pr | ||
with: | ||
script: | | ||
const request = { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.issue.number | ||
} | ||
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`) | ||
try { | ||
const result = await github.pulls.get(request) | ||
return result.data | ||
} catch (err) { | ||
core.setFailed(`Request failed with error ${err}`) | ||
} | ||
- name: get pr env | ||
id: pr-env | ||
run: | | ||
BRANCH_NAME=${{ fromJSON(steps.get-pr.outputs.result).head.ref }} | ||
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT | ||
- name: Checkout code repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ steps.pr-env.outputs.BRANCH_NAME }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: ./.github/actions/setup | ||
with: | ||
npm-token: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Install & build | ||
shell: bash | ||
run: | | ||
node .release/scripts/install.js | ||
node common/scripts/install-run-rush.js install -t @bnb-chain/${{inputs.package-name}} | ||
node common/scripts/install-run-rush.js build -t @bnb-chain/${{inputs.package-name}} | ||
- name: Enter pre mode | ||
run: pnpm ci:enter | ||
|
||
- name: Create and publish versions | ||
uses: changesets/action@v1 | ||
with: | ||
version: pnpm ci:alpha-version | ||
publish: pnpm ci:publish | ||
commit: 'chore: Update versions' | ||
title: 'chore: Update versions' | ||
cwd: '.release' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
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 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