Skip to content

CI

CI #5101

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Check every 15 minutes
schedule:
- cron: "*/15 * * * *"
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Clean Failed Runs
run: |
FAILED_JOBS=`curl -u ${{ secrets.USER }}:${{ secrets.API_TOKEN }} -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/meta-flutter/flutter-channel-watch/actions/runs | \
jq -r '.workflow_runs[] | \
select(.head_branch != "master" and .conclusion == "failure") | \
"\(.id)"'`
for i in ${FAILED_JOBS}; do
curl -X DELETE -u ${{ secrets.USER }}:${{ secrets.API_TOKEN }} -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/meta-flutter/flutter-channel-watch/actions/runs/$i
done
- name: Get flutter engine.version for each channel
run: |
wget -O stable https://raw.githubusercontent.com/flutter/flutter/stable/bin/internal/engine.version
ls -la
- name: Setup git
run: |
env
git config --global user.email "joel.winarske@gmail.com"
git config --global user.name "Joel Winarske"
which ssh-agent || (apt-get update -y && apt-get install openssh-client -y)
eval $(ssh-agent -s)
echo "${{ secrets.SSH_PRIVATE_KEY }}" | tr -d '\r' | ssh-add -
mkdir -p $HOME/.ssh
chmod 700 $HOME/.ssh
echo ${{ secrets.SSH_KNOWN_HOSTS }} | >> $HOME/.ssh/known_hosts
chmod 644 $HOME/.ssh/known_hosts
git remote -v
- name: Check Roll
run: |
if git diff-index --quiet HEAD --; then
echo "No changes" | false
else
echo "Delta"
git add .
git commit -m "Roll"
git push
export srcrev=$(cat stable)
curl -L -X POST \
-H "Accept:application/vnd.github+json" \
-H "Authorization:Bearer ${{ secrets.WORKFLOW }}" \
-H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/meta-flutter/flutter-engine/actions/workflows/flutter-engine-x86_64.yaml/dispatches \
-d '{"ref":"main","inputs":{"srcrev":"'"${srcrev}"'","release": true}}'
curl -L -X POST \
-H "Accept:application/vnd.github+json" \
-H "Authorization:Bearer ${{ secrets.WORKFLOW }}" \
-H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/meta-flutter/flutter-engine/actions/workflows/flutter-engine-arm64.yaml/dispatches \
-d '{"ref":"main","inputs":{"srcrev":"'"${srcrev}"'","release": true}}'
curl -L -X POST \
-H "Accept:application/vnd.github+json" \
-H "Authorization:Bearer ${{ secrets.WORKFLOW }}" \
-H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/meta-flutter/flutter-engine/actions/workflows/flutter-engine-armv7hf.yaml/dispatches \
-d '{"ref":"main","inputs":{"srcrev":"'"${srcrev}"'","release": true}}'
fi