Add env-flutter #111
This file contains 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: "build" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
linux-images: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- env-alpine | |
- env-android:jdk17 | |
- env-android:jdk21 | |
- env-android:latest | |
- env-archlinux | |
- env-debian | |
- env-fedora | |
- env-flutter:android | |
- env-flutter:linux | |
- env-opensuse | |
- env-sphinx | |
- env-ubuntu:14.04 | |
- env-ubuntu:16.04 | |
- env-ubuntu:18.04 | |
- env-ubuntu:20.04 | |
- env-ubuntu:22.04 | |
- env-ubuntu:24.04 | |
- env-ubuntu:latest | |
- env-ubuntu:nolibs | |
- toolchain-aarch64-linux-gnu | |
- toolchain-arm-bcm2708hardfp-linux-gnueabi | |
- toolchain-arm-linux-gnueabihf | |
- toolchain-mips-openwrt-linux-atheros | |
- toolchain-linux-android | |
name: linux/${{ matrix.image }} | |
env: | |
CACHE_FROM: /tmp/.buildx-cache | |
CACHE_TO: /tmp/.buildx-cache-new | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CACHE_FROM }} | |
key: ${{ matrix.image }}-${{ github.sha }} | |
restore-keys: | | |
linux-${{ matrix.image }}- | |
- name: Setup buildx | |
run: | | |
docker buildx create --use | |
- name: Setup env | |
if: | | |
github.repository_owner == 'roc-streaming' && | |
github.event_name == 'push' && | |
github.ref == 'refs/heads/main' | |
run: | | |
echo "ENABLE_PUSH=1" >> $GITHUB_ENV | |
- name: Run docker | |
run: | | |
if [[ $ENABLE_PUSH = 1 ]]; then \ | |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} | |
./make.py --push ${{ matrix.image }} | |
else | |
./make.py ${{ matrix.image }} | |
fi | |
- name: Move cache | |
if: always() | |
run: | | |
if [ -e ${CACHE_TO} ]; then | |
rm -rf ${CACHE_FROM} | |
mv ${CACHE_TO} ${CACHE_FROM} | |
fi | |
- name: Save cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ${{ env.CACHE_FROM }} | |
key: linux-${{ matrix.image }}-${{ github.sha }} | |
windows-images: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- env-flutter | |
name: windows/${{ matrix.image }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup cache | |
uses: ScribeMD/[email protected] | |
with: | |
key: windows-${{ matrix.image }} | |
- name: Setup env | |
if: | | |
github.repository_owner == 'roc-streaming' && | |
github.event_name == 'push' && | |
github.ref == 'refs/heads/main' | |
run: | | |
echo "ENABLE_PUSH=1" >> $env:GITHUB_ENV | |
- name: Run docker | |
env: | |
ENABLE_PUSH: ${{ env.ENABLE_PUSH }} | |
run: | | |
if ($env:ENABLE_PUSH -eq "1") { | |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} | |
python make.py --push ${{ matrix.image }} | |
} else { | |
python make.py ${{ matrix.image }} | |
} |