forked from Scaffold-Stark/scaffold-stark-2
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Challenge-token-vendor last Version Scaffold Stark (#102)
Co-authored-by: Carlos Ramos <[email protected]> Co-authored-by: Gabriela del Pilar Rojas <[email protected]> Co-authored-by: 0xquantum3labs <[email protected]> Co-authored-by: jrcarlos2000 <[email protected]> Co-authored-by: Daniel Calderón Díaz <[email protected]> Co-authored-by: gianmalarcon <[email protected]> Co-authored-by: Ugonna Paul Dike <[email protected]> Co-authored-by: Eduardo <[email protected]> Co-authored-by: Eduardo <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: oceanlvr <[email protected]> Co-authored-by: Quantum3Labs <[email protected]> Co-authored-by: gianalarcon <[email protected]> Co-authored-by: Gabriela del Pilar Rojas <[email protected]> Co-authored-by: Richard <[email protected]> Co-authored-by: CarlosR <[email protected]> Co-authored-by: Abdulhakeem Abdulazeez Ayodeji <[email protected]> Co-authored-by: Ikem <[email protected]> Co-authored-by: Wolf <[email protected]> Co-authored-by: Joseph Chimebuka <[email protected]> Co-authored-by: Jemiiah <[email protected]>
- Loading branch information
1 parent
7b1ec65
commit daa6d8d
Showing
42 changed files
with
1,654 additions
and
634 deletions.
There are no files selected for viewing
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,64 @@ | ||
name: scaffold-stark-demo workflow | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: [main] | ||
paths: | ||
- 'packages/nextjs/**' | ||
|
||
jobs: | ||
version-bump-nextjs: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
- name: Checkout Source Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Quantum3-Labs/scaffold-stark-2 | ||
token: ${{ secrets.ORG_GITHUB_TOKEN }} | ||
path: source_repo | ||
|
||
- name: Modify scaffoldConfig in Source Repository | ||
run: | | ||
cd source_repo | ||
sed -i 's/targetNetworks: \[chains.devnet\]/targetNetworks: \[chains.sepolia\]/' packages/nextjs/scaffold.config.ts | ||
cat packages/nextjs/scaffold.config.ts | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
registry-url: 'https://registry.yarnpkg.com' | ||
|
||
- name: Deploy to vercel | ||
if: success() | ||
id: deploy | ||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | ||
run: | | ||
cd source_repo | ||
yarn install | ||
vercel link --yes --project $VERCEL_PROJECT_ID --token $VERCEL_TOKEN --scope $VERCEL_ORG_ID | ||
vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true --prod --token $VERCEL_TOKEN --scope $VERCEL_ORG_ID | ||
- name: Notify Slack on Success | ||
if: success() | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-message: "GitHub deployed to vercel result: ${{ job.status }}\nRepository Name: ${{ github.repository }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
- name: Notify Slack on Failure | ||
if: failure() | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-message: "GitHub deployed to vercel result: ${{ job.status }}\nRepository Name: ${{ github.repository }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Version Bump and Notify | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: [main] | ||
|
||
jobs: | ||
version-bump: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout Source Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Quantum3-Labs/scaffold-stark-2 | ||
token: ${{ secrets.ORG_GITHUB_TOKEN }} | ||
path: source_repo | ||
|
||
- name: Checkout Destination Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Quantum3-Labs/create-stark | ||
token: ${{ secrets.ORG_GITHUB_TOKEN }} | ||
path: destination_repo | ||
|
||
- name: Determine version bump type | ||
id: version | ||
run: | | ||
cd source_repo | ||
commit_message=$(git log -1 --pretty=%B) | ||
if [[ "$commit_message" == *"[major]"* ]]; then | ||
echo "type=major" >> "$GITHUB_ENV" | ||
elif [[ "$commit_message" == *"[minor]"* ]]; then | ||
echo "type=minor" >> "$GITHUB_ENV" | ||
else | ||
echo "type=patch" >> "$GITHUB_ENV" | ||
fi | ||
- name: Bump version in Source Repository | ||
id: bump-version-source | ||
run: | | ||
cd source_repo | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
new_version=$(npm version ${{ env.type }} -m "chore(release): %s [skip ci]") | ||
echo "NEW_VERSION=${new_version}" >> "$GITHUB_ENV" | ||
git push origin main --follow-tags | ||
- name: Copy Files to Destination Repository | ||
run: | | ||
rsync -av --delete --exclude='.git' source_repo/ destination_repo/templates/base | ||
cd destination_repo | ||
git add . | ||
git commit -m "chore: sync files from scaffold-stark-2 [skip ci]" | ||
- name: Format .gitignore files | ||
run: | | ||
find destination_repo/templates/base -type f -name ".gitignore" | while read -r gitignore_file; do | ||
mjs_file="${gitignore_file%/*}/.gitignore.template.mjs" | ||
gitignore_content=$(cat "$gitignore_file") | ||
cat > "$mjs_file" <<-EOF | ||
const contents = () => | ||
\`${gitignore_content}\` | ||
export default contents; | ||
EOF | ||
rm "$gitignore_file" | ||
done | ||
cd destination_repo | ||
git add . | ||
git commit -m "Processed $gitignore_file into $mjs_file" | ||
- name: Bump version in Destination Repository | ||
id: bump-version-destination | ||
run: | | ||
cd destination_repo | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
new_version=$(npm version ${{ env.type }} -m "chore(release): %s [skip ci]") | ||
git push origin main --follow-tags | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
registry-url: 'https://registry.npmjs.org/' | ||
|
||
- name: Publish release | ||
if: success() | ||
id: publish-release | ||
run: | | ||
cd destination_repo | ||
npm install && npm run build && npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Notify Slack on Success | ||
if: success() | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-message: "GitHub Action succeeded for version bump to ${{ env.NEW_VERSION }}." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
- name: Notify Slack on Failure | ||
if: failure() | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-message: "GitHub Action failed for version bump." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_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
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
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 |
---|---|---|
|
@@ -228,4 +228,4 @@ const TokenVendor: NextPage = () => { | |
); | ||
}; | ||
|
||
export default TokenVendor; | ||
export default TokenVendor; |
Oops, something went wrong.