Skip to content

Commit

Permalink
Add steps to build new project and include in PR pipeline (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
stwiname authored Apr 28, 2024
1 parent facd1e2 commit 6ff4dba
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/chain_support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,21 @@ jobs:
- name: Cat input.json
run: |
cat input.json
- name: Setup Env
run: |
formattedName=$(echo "${{ steps.issue-parser.outputs.issueparser_name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
formattedEnvironment=$(echo "${{ steps.issue-parser.outputs.issueparser_environment }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
folderName="${{ steps.issue-parser.outputs.issueparser_name }}"
subFolderName="$formattedName-$formattedEnvironment-starter"
echo "formattedName=$formattedName" >> $GITHUB_ENV
echo "formattedEnvironment=$formattedEnvironment" >> $GITHUB_ENV
echo "folderName=$folderName" >> $GITHUB_ENV
echo "subFolderName=$subFolderName" >> $GITHUB_ENV
- name: Create Issue Branch
env:
number: ${{ github.event.issue.number }}
title: ${{ github.event.issue.title }}
run: |
formattedName=$(echo "${{ steps.issue-parser.outputs.issueparser_name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
formattedEnvironment=$(echo "${{ steps.issue-parser.outputs.issueparser_environment }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
branchname=$number-$formattedName-$formattedEnvironment
git switch -c "$branchname"
git config --global user.name 'github-actions'
Expand All @@ -48,10 +56,6 @@ jobs:
echo "branchname=$branchname" >> $GITHUB_ENV
- name: Make Changes to PR
run: |
formattedName=$(echo "${{ steps.issue-parser.outputs.issueparser_name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
formattedEnvironment=$(echo "${{ steps.issue-parser.outputs.issueparser_environment }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
folderName="${{ steps.issue-parser.outputs.issueparser_name }}"
subFolderName="$formattedName-$formattedEnvironment-starter"
echo $formattedName
echo $formattedEnvironment
echo $folderName
Expand All @@ -67,6 +71,17 @@ jobs:
.github/node_modules/mustache/bin/mustache input.json .github/template/template/package.json > "$folderName"/$subFolderName/package.json
rm input.json
git add .
- name: Validate project
run: |
cd "$folderName/$subFolderName"
yarn && yarn codegen && yarn build
- name: Update PR workflow
run: |
file_path = ".github/scripts/ci.package.json"
existing=$(jq '.workspaces | index("'"$folderName"'")' "$file_path")
if [ "$existing" == "null" ]; then
jq '.workspaces += ["'"$folderName"'"]' "$file_path" > "$file_path.tmp" && mv "$file_path.tmp" "$file_path"
fi
- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v6
Expand Down

0 comments on commit 6ff4dba

Please sign in to comment.