|
| 1 | +name: Launch build of development conda packages of SOFA |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | +jobs: |
| 7 | + run: |
| 8 | + runs-on: ubuntu-slim |
| 9 | + if: ${{ github.repository_owner == 'sofa-framework' }} |
| 10 | + |
| 11 | + steps: |
| 12 | + # first extract SOFA and SofaPython3 last commit sha and date on their resp |
| 13 | + # master branches, which be used as ref for building the devel conda packages |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - name: Get SOFA commit date |
| 16 | + run: | |
| 17 | + SOFA_COMMIT_DATE=$(git show -s --date=format:%Y%m%d --format=%cd ${{ github.sha }}) |
| 18 | + echo "SOFA_COMMIT_DATE=$SOFA_COMMIT_DATE" >> $GITHUB_ENV |
| 19 | +
|
| 20 | + - name: Checkout SOFA Python3 |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + repository: sofa-framework/SofaPython3 |
| 24 | + ref: master |
| 25 | + token: ${{ secrets.PERF_REG_TOKEN }} |
| 26 | + path: SofaPython3 |
| 27 | + |
| 28 | + - name: Get commit info |
| 29 | + run: | |
| 30 | + cd SofaPython3 |
| 31 | + SOFA_PYTHON3_SHA=$(git rev-parse HEAD) |
| 32 | + SOFA_PYTHON3_COMMIT_DATE=$(git show -s --format=%cI HEAD) |
| 33 | +
|
| 34 | + echo "SOFA_PYTHON3_SHA=$SOFA_PYTHON3_SHA" >> $GITHUB_ENV |
| 35 | + echo "SOFA_PYTHON3_COMMIT_DATE=$SOFA_PYTHON3_COMMIT_DATE" >> $GITHUB_ENV |
| 36 | +
|
| 37 | + - name: Get SOFA Python3 last commit and date on master |
| 38 | + run: | |
| 39 | + SOFA_PYTHON3_COMMIT_DATE=$(git show -s --date=format:%Y%m%d --format=%cd ${{ github.sha }}) |
| 40 | + echo "COMMIT_DATE=$COMMIT_DATE" >> $GITHUB_ENV |
| 41 | +
|
| 42 | + - name: Launch build of development conda packages of SOFA |
| 43 | + run: | |
| 44 | + sudo apt install curl |
| 45 | + |
| 46 | + curl -L -X POST \ |
| 47 | + -H "Accept: application/vnd.github+json" \ |
| 48 | + -H "Authorization: Bearer ${{ secrets.PERF_REG_TOKEN }}" \ |
| 49 | + -H "X-GitHub-Api-Version: 2022-11-28" \ |
| 50 | + https://api.github.com/repos/sofa-framework/conda-ci/dispatches \ |
| 51 | + -d '{"event_type":"build-devel-sofa-all","client_payload":{"sofa_commit_date":"$SOFA_COMMIT_DATE","sofa_commit_hash":"${{ github.sha }}","sofa_python3_commit_date":"$SOFA_PYTHON3_COMMIT_DATE","sofa_python3_commit_hash":"$SOFA_PYTHON3_SHA"}}' |
0 commit comments