Push to eltos/typst-packages #75
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: Push to eltos/typst-packages | |
| on: | |
| workflow_run: | |
| branches: [main] | |
| workflows: [test] | |
| types: [completed] | |
| jobs: | |
| push-to-eltos-typst-packages: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: accelerated-jacow | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: eltos/typst-packages | |
| ssh-key: ${{ secrets.ELTOS_TYPST_PACKAGES_DEPLOY_KEY }} | |
| path: typst-packages | |
| - name: Extract version | |
| run: | | |
| VERSION=$(awk -F'= *' '/^version/{gsub(/"/,"",$2);print $2}' accelerated-jacow/typst.toml) | |
| echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
| - name: Copy, commit & push | |
| run: | | |
| cd typst-packages | |
| git branch -D accelerated-jacow-$VERSION 2>/dev/null || true | |
| git checkout -b accelerated-jacow-$VERSION | |
| mkdir -p packages/preview/accelerated-jacow/$VERSION | |
| rm -drf packages/preview/accelerated-jacow/$VERSION/* | |
| # Copy | |
| cp -r ../accelerated-jacow/* packages/preview/accelerated-jacow/$VERSION/ | |
| rm -drf packages/preview/accelerated-jacow/$VERSION/tests | |
| ls -l packages/preview/accelerated-jacow/$VERSION/ | |
| # Commit | |
| git config user.name "Eltos" | |
| git config user.email "[email protected]" | |
| git add packages/preview/accelerated-jacow/$VERSION/ | |
| git commit -m "accelerated-jacow:$VERSION" | |
| git config push.autoSetupRemote true | |
| git push --force |