clad via clad trunk #476
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
| ### DO NOT EDIT - created by a script ### | |
| name: clad via clad trunk | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| check-activity: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_build: ${{ steps.check.outputs.should_build }} | |
| steps: | |
| - name: Check for recent commits | |
| id: check | |
| run: | | |
| REPOS='["https://github.com/vgvassilev/clad/tree/master"]' | |
| STALE_DAYS=7 | |
| SINCE_DATE=$(date -d "${STALE_DAYS} days ago" --iso-8601=seconds) | |
| echo "Checking for commits since ${SINCE_DATE} (${STALE_DAYS} days ago)" | |
| HAS_RECENT=false | |
| for repo in $(echo "$REPOS" | jq -r '.[]'); do | |
| REPO_PATH=$(echo "$repo" | sed -E 's|https://github.com/([^/]+/[^/]+).*|\1|') | |
| BRANCH=$(echo "$repo" | sed -n -E 's|https://github.com/[^/]+/[^/]+/tree/(.+)|\1|p') | |
| if [ -n "$BRANCH" ]; then | |
| echo "Checking $REPO_PATH (branch: $BRANCH) for recent commits..." | |
| COMMITS=$(curl -sf "https://api.github.com/repos/${REPO_PATH}/commits?sha=${BRANCH}&since=${SINCE_DATE}&per_page=1" || echo "[]") | |
| else | |
| echo "Checking $REPO_PATH (default branch) for recent commits..." | |
| COMMITS=$(curl -sf "https://api.github.com/repos/${REPO_PATH}/commits?since=${SINCE_DATE}&per_page=1" || echo "[]") | |
| fi | |
| if [ "$(echo "$COMMITS" | jq 'length')" -gt 0 ]; then | |
| echo "Found recent commits in $repo" | |
| HAS_RECENT=true | |
| break | |
| fi | |
| done | |
| if [ "$HAS_RECENT" = "true" ]; then | |
| echo "should_build=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "No recent commits in any repo (within ${STALE_DAYS} days), skipping build" | |
| echo "should_build=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| daily-build: | |
| needs: check-activity | |
| if: ${{ needs.check-activity.outputs.should_build == 'true' }} | |
| runs-on: [ 'self-hosted', 'ce', 'linux', 'x64', 'small' ] | |
| steps: | |
| - name: Start from a clean directory | |
| run: sudo find "$GITHUB_WORKSPACE" -mindepth 1 -delete | |
| - uses: actions/checkout@v6 | |
| - name: Run the build | |
| uses: ./.github/actions/daily-build | |
| with: | |
| image: clad | |
| name: clad | |
| command: build.sh | |
| args: trunk | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |