|
| 1 | +name: Generate CI pipelines for ROS 2 packages |
| 2 | + |
| 3 | +permissions: |
| 4 | + actions: write |
| 5 | + contents: write |
| 6 | + |
| 7 | +env: |
| 8 | + ROS_VERSION: 2 |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token |
| 17 | + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo |
| 18 | + - uses: actions/setup-python@v5 |
| 19 | + with: |
| 20 | + python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax |
| 21 | + - name: Install vinca |
| 22 | + run: | |
| 23 | + pip install git+https://github.com/RoboStack/vinca.git |
| 24 | +
|
| 25 | + - name: Generate recipes for linux-64 |
| 26 | + run: | |
| 27 | + git clean -fdx |
| 28 | + cp vinca_linux_64.yaml vinca.yaml |
| 29 | + vinca --multiple --platform linux-64 |
| 30 | + - name: Generate azure pipelines for linux-64 |
| 31 | + run: | |
| 32 | + vinca-gha --platform linux-64 --trigger-branch buildbranch_linux -d ./recipes --additional-recipes |
| 33 | + - name: Commit files for linux-64 |
| 34 | + run: | |
| 35 | + if [[ -f "linux.yml" ]]; then |
| 36 | + mv linux.yml .github/workflows/ |
| 37 | + git config --local user.email "action@github.com" |
| 38 | + git config --local user.name "GitHub Action" |
| 39 | + git add . -f |
| 40 | + git commit -m "Add build files `date '+%Y-%m-%d-%H%M'`" -a |
| 41 | + remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" |
| 42 | + git push "${remote_repo}" HEAD:buildbranch_linux --follow-tags --force |
| 43 | + fi |
| 44 | + env: |
| 45 | + INPUT_GITHUB_TOKEN: ${{ secrets.GHA_PAT }} |
| 46 | + |
| 47 | + # Generate recipes for osx |
| 48 | + - name: Reset repo |
| 49 | + run: | |
| 50 | + git reset --hard origin/main |
| 51 | + - name: Generate recipes for osx-64 |
| 52 | + run: | |
| 53 | + git clean -fdx |
| 54 | + cp vinca_osx.yaml vinca.yaml |
| 55 | + vinca --multiple --platform osx-64 |
| 56 | + - name: Generate azure pipelines for osx-64 |
| 57 | + run: | |
| 58 | + vinca-gha --platform osx-64 --trigger-branch buildbranch_osx -d ./recipes --additional-recipes |
| 59 | + - name: Commit files for osx-64 |
| 60 | + run: | |
| 61 | + if [[ -f "osx.yml" ]]; then |
| 62 | + mv osx.yml .github/workflows/ |
| 63 | + git config --local user.email "action@github.com" |
| 64 | + git config --local user.name "GitHub Action" |
| 65 | + git add . -f |
| 66 | + git commit -m "Add build files `date '+%Y-%m-%d-%H%M'`" -a |
| 67 | + remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" |
| 68 | + git push "${remote_repo}" HEAD:buildbranch_osx --follow-tags --force |
| 69 | + fi |
| 70 | + env: |
| 71 | + INPUT_GITHUB_TOKEN: ${{ secrets.GHA_PAT }} |
| 72 | + |
| 73 | + # Generate recipes for osx-arm64 |
| 74 | + - name: Reset repo |
| 75 | + run: | |
| 76 | + git reset --hard origin/main |
| 77 | + - name: Generate recipes for osx-arm64 |
| 78 | + run: | |
| 79 | + git clean -fdx |
| 80 | + cp vinca_osx_arm64.yaml vinca.yaml |
| 81 | + vinca --multiple --platform osx-arm64 |
| 82 | + - name: Generate azure pipelines for osx-arm64 |
| 83 | + run: | |
| 84 | + vinca-gha --platform osx-arm64 --trigger-branch buildbranch_osx_arm64 -d ./recipes --additional-recipes |
| 85 | + - name: Commit files for osx-arm64 |
| 86 | + run: | |
| 87 | + if [[ -f "osx_arm64.yml" ]]; then |
| 88 | + mv osx_arm64.yml .github/workflows/ |
| 89 | + git config --local user.email "action@github.com" |
| 90 | + git config --local user.name "GitHub Action" |
| 91 | + git add . -f |
| 92 | + git commit -m "Add build files `date '+%Y-%m-%d-%H%M'`" -a |
| 93 | + remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" |
| 94 | + git push "${remote_repo}" HEAD:buildbranch_osx_arm64 --follow-tags --force |
| 95 | + fi |
| 96 | + env: |
| 97 | + INPUT_GITHUB_TOKEN: ${{ secrets.GHA_PAT }} |
| 98 | + |
| 99 | + # Generate recipes for Windows |
| 100 | + - name: Reset repo |
| 101 | + run: | |
| 102 | + git reset --hard origin/main |
| 103 | + - name: Generate recipes for win-64 |
| 104 | + run: | |
| 105 | + git clean -fdx |
| 106 | + cp vinca_win.yaml vinca.yaml |
| 107 | + vinca --multiple --platform win-64 |
| 108 | + - name: Generate azure pipelines for win-64 |
| 109 | + run: | |
| 110 | + vinca-gha --platform win-64 --trigger-branch buildbranch_win -d ./recipes --additional-recipes |
| 111 | + - name: Commit files for win-64 |
| 112 | + run: | |
| 113 | + if [[ -f "win.yml" ]]; then |
| 114 | + mv win.yml .github/workflows/ |
| 115 | + git config --local user.email "action@github.com" |
| 116 | + git config --local user.name "GitHub Action" |
| 117 | + git add . -f |
| 118 | + git commit -m "Add build files `date '+%Y-%m-%d-%H%M'`" -a |
| 119 | + remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" |
| 120 | + git push "${remote_repo}" HEAD:buildbranch_win --follow-tags --force |
| 121 | + fi |
| 122 | + env: |
| 123 | + INPUT_GITHUB_TOKEN: ${{ secrets.GHA_PAT }} |
| 124 | + |
| 125 | + # Generate recipes for Linux ARM64 |
| 126 | + - name: Reset repo |
| 127 | + run: | |
| 128 | + git reset --hard origin/main |
| 129 | + - name: Generate recipes for linux-aarch64 |
| 130 | + run: | |
| 131 | + git clean -fdx |
| 132 | + cp vinca_linux_aarch64.yaml vinca.yaml |
| 133 | + vinca --multiple --platform linux-aarch64 |
| 134 | + - name: Generate azure pipelines for linux-aarch64 |
| 135 | + run: | |
| 136 | + vinca-gha --platform linux-aarch64 --trigger-branch buildbranch_linux_aarch64 -d ./recipes --additional-recipes |
| 137 | + - name: Commit files for linux-aarch64 |
| 138 | + run: | |
| 139 | + if [[ -f "linux_aarch64.yml" ]]; then |
| 140 | + mv linux_aarch64.yml .github/workflows/build_linux_aarch64.yml |
| 141 | + git config --local user.email "action@github.com" |
| 142 | + git config --local user.name "GitHub Action" |
| 143 | + git add . -f |
| 144 | + git commit -m "Add build files `date '+%Y-%m-%d-%H%M'`" -a |
| 145 | + remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" |
| 146 | + git push "${remote_repo}" HEAD:buildbranch_linux_aarch64 --follow-tags --force |
| 147 | + fi |
| 148 | + env: |
| 149 | + INPUT_GITHUB_TOKEN: ${{ secrets.GHA_PAT }} |
| 150 | + |
| 151 | +on: |
| 152 | + push: |
| 153 | + branches: |
| 154 | + - master |
| 155 | + - main |
0 commit comments