Sync rules_mc to GitHub #7
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: Sync rules_mc to GitHub | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'rules_mc/**' | |
| workflow_dispatch: | |
| inputs: | |
| flags: | |
| description: Flags to be passed to Copybara | |
| required: false | |
| default: "" | |
| type: string | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout monorepo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - uses: nttld/setup-ndk@v1 | |
| id: setup-ndk | |
| with: | |
| ndk-version: r28b | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@0.14.0 | |
| - name: Run Copybara sync | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.COPYBARA_RULES_MC_TOKEN }} | |
| FLAGS: ${{ inputs.flags }} | |
| run: | | |
| git config --global user.name Copybara | |
| git config --global user.email copybara@copybara | |
| git config --global credential.helper store | |
| echo "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com" > ~/.git-credentials | |
| bazel run --run_under="cd $PWD &&" //copybara -- copybara/copy.bara.sky rules_mc $FLAGS |