Add cap71 xdr #13
Workflow file for this run
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: Generate | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| complete: | |
| if: always() | |
| needs: [generate] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
| run: exit 1 | |
| generate: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - branch: curr | |
| preprocess_flags: "" | |
| - branch: next | |
| preprocess_flags: "--all-features" | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v4 | |
| with: | |
| path: main | |
| - name: Checkout ${{ matrix.branch }} | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ matrix.branch }} | |
| path: ${{ matrix.branch }} | |
| - name: Install stellar-xdr CLI | |
| run: cargo install --locked stellar-xdr --features cli | |
| - name: Remove all files from ${{ matrix.branch }} | |
| working-directory: ${{ matrix.branch }} | |
| run: git rm -rf . | |
| - name: Copy files from main | |
| run: cp main/*.x main/Makefile main/LICENSE main/README.md ${{ matrix.branch }}/ | |
| - name: Preprocess XDR files | |
| working-directory: ${{ matrix.branch }} | |
| run: make preprocess PREPROCESS_FLAGS="${{ matrix.preprocess_flags }}" | |
| - name: Show diff | |
| working-directory: ${{ matrix.branch }} | |
| run: | | |
| git add -A | |
| git diff --cached --color=always | |
| - name: Commit and push | |
| if: github.event_name == 'push' | |
| working-directory: ${{ matrix.branch }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "Generate from main ($(git -C ../main rev-parse --short HEAD))" | |
| git push | |
| fi |