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

Add steps to build new project and include in PR pipeline #97

Merged
merged 1 commit into from
Apr 28, 2024
Merged
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
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