chore(release): 2.0.0 [major] #60
This file contains hidden or 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
| name: Basecamp Sync and Update | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: [main] | |
| jobs: | |
| check_commit: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| outputs: | |
| SHOULD_RUN: ${{ steps.check_commit.outputs.SHOULD_RUN }} | |
| steps: | |
| - name: Checkout Files | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.ORG_GITHUB_TOKEN }} | |
| - name: check if skip ci | |
| id: check_commit | |
| run: | | |
| COMMIT_MESSAGE=$(git log -1 --pretty=%B) | |
| if [[ "$COMMIT_MESSAGE" == *"[skip ci]"* ]]; then | |
| echo "SHOULD_RUN=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "SHOULD_RUN=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| sync-basecamp: | |
| needs: check_commit | |
| if: ${{ needs.check_commit.outputs.SHOULD_RUN != 'false' }} | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout Source Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Scaffold-Stark/scaffold-stark-2 | |
| token: ${{ secrets.ORG_GITHUB_TOKEN }} | |
| path: source_repo | |
| - name: Checkout Basecamp Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Scaffold-Stark/basecamp | |
| token: ${{ secrets.ORG_GITHUB_TOKEN }} | |
| path: basecamp_repo | |
| fetch-depth: 0 | |
| - name: Setup Git | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Sync Base Branch | |
| run: | | |
| cd basecamp_repo | |
| git checkout base | |
| rsync -av --delete \ | |
| --exclude='.git/' \ | |
| --include='.github/' \ | |
| --include='.github/workflows/' \ | |
| --include='.github/workflows/main.yml' \ | |
| --exclude='.github/*' \ | |
| --exclude='.github/workflows/*' \ | |
| --exclude='__test*__' \ | |
| --exclude='packages/nextjs/public/debug-image.png' \ | |
| --exclude='packages/nextjs/public/manifest.json' \ | |
| --exclude='packages/nextjs/public/rpc-version.png' \ | |
| --exclude='CHANGELOG*' \ | |
| --exclude='CONTRIBUTING*' \ | |
| --exclude='README.md' \ | |
| ../source_repo/ ./ | |
| git add . | |
| git commit -m "chore: sync files from scaffold-stark-2 [skip ci]" | |
| git push origin base | |
| - name: Update Step Branches | |
| run: | | |
| cd basecamp_repo | |
| git checkout step-0 && git merge base --no-edit && git push origin step-0 | |
| git checkout step-1 && git merge step-0 --no-edit && git push origin step-1 | |
| git checkout step-2 && git merge step-1 --no-edit && git push origin step-2 | |
| git checkout step-3 && git merge step-2 --no-edit && git push origin step-3 | |
| - name: Notify Slack on Success | |
| if: success() | |
| uses: slackapi/slack-github-action@v1.26.0 | |
| with: | |
| channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | |
| slack-message: "Successfully synced scaffold-stark-2 changes to basecamp repository and updated all step branches." | |
| env: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
| - name: Notify Slack on Failure | |
| if: failure() | |
| uses: slackapi/slack-github-action@v1.26.0 | |
| with: | |
| channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | |
| slack-message: "Failed to sync scaffold-stark-2 changes to basecamp repository." | |
| env: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |