Watch Upstream Releases #44
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: Watch Upstream Releases | |
| on: | |
| schedule: | |
| - cron: '*/30 * * * *' | |
| workflow_dispatch: | |
| permissions: | |
| actions: write | |
| jobs: | |
| check-ironclaw: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new_release: ${{ steps.cache.outputs.cache-hit != 'true' }} | |
| tag: ${{ steps.release.outputs.tag }} | |
| version: ${{ steps.release.outputs.version }} | |
| steps: | |
| - name: Get latest ironclaw release tag | |
| id: release | |
| run: | | |
| TAG=$(gh release view --repo nearai/ironclaw --json tagName -q '.tagName') | |
| VERSION=${TAG#ironclaw-v} | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Latest ironclaw release: $TAG (version $VERSION)" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Check if already built | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .ironclaw-release-marker | |
| key: ironclaw-release-${{ steps.release.outputs.tag }} | |
| - name: Save marker for cache | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: echo "${{ steps.release.outputs.tag }}" > .ironclaw-release-marker | |
| check-openclaw: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new_release: ${{ steps.cache.outputs.cache-hit != 'true' }} | |
| tag: ${{ steps.release.outputs.tag }} | |
| version: ${{ steps.release.outputs.version }} | |
| steps: | |
| - name: Get latest openclaw release tag | |
| id: release | |
| run: | | |
| TAG=$(gh release view --repo openclaw/openclaw --json tagName -q '.tagName') | |
| VERSION=${TAG#v} | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Latest openclaw release: $TAG (version $VERSION)" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Check if already built | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .openclaw-release-marker | |
| key: openclaw-release-${{ steps.release.outputs.tag }} | |
| - name: Save marker for cache | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: echo "${{ steps.release.outputs.tag }}" > .openclaw-release-marker | |
| trigger-build: | |
| needs: [check-ironclaw, check-openclaw] | |
| if: needs.check-ironclaw.outputs.new_release == 'true' || needs.check-openclaw.outputs.new_release == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger single build | |
| run: | | |
| ARGS="" | |
| if [[ "${{ needs.check-ironclaw.outputs.new_release }}" == "true" ]]; then | |
| ARGS="$ARGS -f ironclaw_version=${{ needs.check-ironclaw.outputs.version }}" | |
| fi | |
| if [[ "${{ needs.check-openclaw.outputs.new_release }}" == "true" ]]; then | |
| ARGS="$ARGS -f openclaw_version=${{ needs.check-openclaw.outputs.version }}" | |
| fi | |
| gh workflow run build.yml --repo ${{ github.repository }} $ARGS | |
| echo "Triggered build (ironclaw=${{ needs.check-ironclaw.outputs.new_release }}, openclaw=${{ needs.check-openclaw.outputs.new_release }})" | |
| [[ "${{ needs.check-ironclaw.outputs.new_release }}" == "true" ]] && echo " ironclaw: ${{ needs.check-ironclaw.outputs.tag }}" | |
| [[ "${{ needs.check-openclaw.outputs.new_release }}" == "true" ]] && echo " openclaw: ${{ needs.check-openclaw.outputs.tag }}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |