schedule #2332
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: schedule | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
schedule: | |
- cron: '0 0/4 * * *' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
latest: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
channel: [stable, beta, dev, edge] | |
outputs: | |
stable-version: ${{ steps.version.outputs.stable-version }} | |
stable-cache-hit: ${{ steps.cache.outputs.stable-cache-hit }} | |
beta-version: ${{ steps.version.outputs.beta-version }} | |
beta-cache-hit: ${{ steps.cache.outputs.beta-cache-hit }} | |
dev-version: ${{ steps.version.outputs.dev-version }} | |
dev-cache-hit: ${{ steps.cache.outputs.dev-cache-hit }} | |
edge-version: ${{ steps.version.outputs.edge-version }} | |
steps: | |
- name: Get ${{ matrix.channel }} version | |
id: version | |
run: | | |
if ${{ matrix.channel == 'edge' && 'true' || 'false' }}; then | |
git ls-remote https://dart.googlesource.com/sdk.git HEAD | tee HEAD | |
echo "${{ matrix.channel }}-version=$(cut -f 1 HEAD)" | tee -a "$GITHUB_OUTPUT" | |
else | |
curl -fsSL "https://storage.googleapis.com/dart-archive/channels/${{ matrix.channel }}/release/latest/VERSION" | tee VERSION | |
echo "${{ matrix.channel }}-version=$(yq .version VERSION)" | tee -a "$GITHUB_OUTPUT" | |
fi | |
- name: Cache | |
id: cache | |
if: matrix.channel != 'edge' | |
run: | | |
if ${{ github.event.schedule && 'true' || 'false' }} && curl -fsSLo /dev/null "${{ github.server_url }}/${{ github.repository }}/releases/tag/$(yq .version VERSION)"; then | |
echo "${{ matrix.channel }}-cache-hit=true" | tee -a "$GITHUB_OUTPUT" | |
else | |
echo "${{ matrix.channel }}-cache-hit=false" | tee -a "$GITHUB_OUTPUT" | |
fi | |
stable: | |
needs: [latest] | |
if: needs.latest.outputs.stable-cache-hit != 'true' | |
permissions: | |
actions: write | |
attestations: write | |
id-token: write | |
uses: ./.github/workflows/build.yml | |
with: | |
ref: ${{ needs.latest.outputs.stable-version }} | |
secrets: inherit | |
beta: | |
needs: [latest] | |
if: needs.latest.outputs.beta-cache-hit != 'true' && needs.latest.outputs.beta-version != needs.latest.outputs.stable-version | |
permissions: | |
actions: write | |
attestations: write | |
id-token: write | |
uses: ./.github/workflows/build.yml | |
with: | |
ref: ${{ needs.latest.outputs.beta-version }} | |
secrets: inherit | |
dev: | |
needs: [latest] | |
if: needs.latest.outputs.dev-cache-hit != 'true' && needs.latest.outputs.dev-version != needs.latest.outputs.beta-version && needs.latest.outputs.dev-version != needs.latest.outputs.stable-version | |
permissions: | |
actions: write | |
attestations: write | |
id-token: write | |
uses: ./.github/workflows/build.yml | |
with: | |
ref: ${{ needs.latest.outputs.dev-version }} | |
secrets: inherit | |
edge: | |
needs: [latest] | |
permissions: | |
actions: write | |
attestations: write | |
id-token: write | |
uses: ./.github/workflows/build.yml | |
with: | |
ref: ${{ needs.latest.outputs.edge-version }} |