ci: Remove CircleCI (everything moved to GH Actions)
This commit is contained in:
parent
212645d9b9
commit
8e8afedccf
|
@ -1,332 +0,0 @@
|
|||
version: 2.1
|
||||
description: Ruffle - Flash Player emulator written in Rust
|
||||
orbs:
|
||||
win: circleci/windows@1.0.0
|
||||
|
||||
jobs:
|
||||
# General testing, linux + web build
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/rust:1.45.1
|
||||
steps:
|
||||
# Git checkout
|
||||
- checkout
|
||||
|
||||
# Restore cached assets (cargo registry)
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v5-cargo-cache-linux-{{ .Revision }}
|
||||
- v5-cargo-cache-linux-
|
||||
|
||||
# Install dependencies
|
||||
- run:
|
||||
name: Setup
|
||||
command: |
|
||||
rustup toolchain install stable
|
||||
rustup run stable rustc --version --verbose
|
||||
rustup component add --toolchain stable clippy
|
||||
rustup run stable cargo clippy --version
|
||||
rustup component add --toolchain stable rustfmt
|
||||
rustup run stable cargo fmt --version
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
||||
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
mkdir workspace
|
||||
|
||||
# Run tests
|
||||
- run:
|
||||
name: Tests
|
||||
command: |
|
||||
rustup run stable cargo test --package=ruffle_core
|
||||
|
||||
# Run cargo clippy and fmt
|
||||
- run:
|
||||
name: Clippy + Format
|
||||
command: |
|
||||
rustup run stable cargo clippy --all --tests -- -D warnings
|
||||
rustup run stable cargo fmt --all -- --check
|
||||
|
||||
# Build the linux binary
|
||||
- run:
|
||||
name: Linux Build
|
||||
command: |
|
||||
rustup run stable cargo build --package ruffle_desktop --release
|
||||
mkdir linux
|
||||
cp target/release/ruffle_desktop linux/ruffle
|
||||
cp README.md LICENSE_APACHE LICENSE_MIT linux
|
||||
cd linux
|
||||
tar -czvf ../workspace/linux.tar.gz *
|
||||
|
||||
# Build web packages
|
||||
- run:
|
||||
name: Web Build
|
||||
command: |
|
||||
cd web
|
||||
|
||||
# Workaround for chrome not existing on circleCI.
|
||||
# We aren't running tests, so we don't need to install chromedriver,
|
||||
# and this file tells chromedriver to require existing chrome installation.
|
||||
rm packages/selfhosted/.npmrc
|
||||
|
||||
npm run bootstrap
|
||||
npm run buildProduction
|
||||
|
||||
# Package the web self-hosted binary
|
||||
- run:
|
||||
name: Web Build
|
||||
command: |
|
||||
cd web/packages/selfhosted/dist
|
||||
zip -r web.zip .
|
||||
cd ../../../..
|
||||
mkdir -p workspace/web
|
||||
cp web/packages/selfhosted/dist/web.zip workspace/web.zip
|
||||
|
||||
# Build the wasm demo binary
|
||||
- run:
|
||||
name: Web Demo Build
|
||||
command: |
|
||||
mkdir -p workspace/web-demo
|
||||
cp web/packages/demo/dist/* workspace/web-demo
|
||||
|
||||
# Build the web extensions
|
||||
- run:
|
||||
name: Extension Builds
|
||||
command: |
|
||||
cp web/packages/extension/dist/ruffle_extension.zip workspace/extension.zip
|
||||
cp web/packages/extension/dist/firefox_unsigned.xpi workspace
|
||||
|
||||
# Save cached assets
|
||||
- save_cache:
|
||||
key: v5-cargo-cache-linux-{{ .Revision }}
|
||||
paths:
|
||||
- "/usr/local/cargo/registry"
|
||||
- "./target"
|
||||
|
||||
# Persist build artifacts for deploy job
|
||||
- persist_to_workspace:
|
||||
root: workspace
|
||||
paths:
|
||||
- linux.tar.gz
|
||||
- extension.zip
|
||||
- firefox_unsigned.xpi
|
||||
- web.zip
|
||||
- web-demo
|
||||
|
||||
# OSX Build
|
||||
build_osx:
|
||||
macos:
|
||||
xcode: "9.3.0"
|
||||
steps:
|
||||
# Git checkout
|
||||
- checkout
|
||||
|
||||
# Restore cached assets (cargo registry)
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v5-cargo-cache-osx-{{ .Revision }}
|
||||
- v5-cargo-cache-osx-
|
||||
|
||||
# Install dependencies
|
||||
- run:
|
||||
name: Setup
|
||||
command: |
|
||||
# Install rustup
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source $HOME/.cargo/env
|
||||
|
||||
# Install stable rust toolchain
|
||||
rustup toolchain install stable
|
||||
rustup run stable rustc --version --verbose
|
||||
rustup run stable cargo --version --verbose
|
||||
|
||||
mkdir workspace
|
||||
|
||||
# Build the OSX binary
|
||||
- run:
|
||||
name: OSX Build
|
||||
command: |
|
||||
source $HOME/.cargo/env
|
||||
rustup run stable cargo build --package ruffle_desktop --release
|
||||
mkdir osx
|
||||
cp target/release/ruffle_desktop osx/ruffle
|
||||
cp README.md LICENSE_APACHE LICENSE_MIT osx
|
||||
cd osx
|
||||
tar -czvf ../workspace/osx.tar.gz *
|
||||
|
||||
# Save cached assets
|
||||
- save_cache:
|
||||
key: v5-cargo-cache-osx-{{ .Revision }}
|
||||
paths:
|
||||
- "~/.cargo/registry"
|
||||
- "./target"
|
||||
|
||||
# Persist build artifacts for deploy job
|
||||
- persist_to_workspace:
|
||||
root: workspace
|
||||
paths:
|
||||
- osx.tar.gz
|
||||
|
||||
# Windows build
|
||||
build_windows:
|
||||
executor:
|
||||
name: win/vs2019
|
||||
shell: powershell.exe
|
||||
steps:
|
||||
# Git checkout
|
||||
- checkout
|
||||
|
||||
# Restore cached assets (cargo registry)
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v5-cargo-cache-windows-{{ .Revision }}
|
||||
- v5-cargo-cache-windows-
|
||||
|
||||
# Install dependencies
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: |
|
||||
# Install rustup
|
||||
$client = new-object System.Net.WebClient
|
||||
$client.DownloadFile('https://win.rustup.rs', "$pwd\rustup-init.exe")
|
||||
.\rustup-init.exe -y
|
||||
|
||||
mkdir workspace
|
||||
|
||||
# Build the Windows binary
|
||||
- run:
|
||||
name: Windows Build
|
||||
command: |
|
||||
# This is necessary because otherwise cargo fails when trying to use git?
|
||||
mkdir .cargo
|
||||
Add-Content .cargo\config "[net]`ngit-fetch-with-cli = true"
|
||||
|
||||
rustup run stable rustc --version --verbose
|
||||
rustup run stable cargo --version --verbose
|
||||
rustup run stable cargo build --package ruffle_desktop --release
|
||||
mkdir windows
|
||||
copy target\release\ruffle_desktop.exe windows\ruffle.exe
|
||||
copy README.md windows
|
||||
copy LICENSE_APACHE windows
|
||||
copy LICENSE_MIT windows\
|
||||
|
||||
# Have to turn off progress bar or CI explodes?!
|
||||
$progressPreference = 'silentlyContinue'
|
||||
Compress-Archive -Path windows\* -CompressionLevel Optimal -DestinationPath workspace\windows.zip
|
||||
|
||||
# Save cached assets
|
||||
- save_cache:
|
||||
key: v5-cargo-cache-windows-{{ .Revision }}
|
||||
paths:
|
||||
- c:\users\circleci\.cargo\registry
|
||||
- target
|
||||
|
||||
# Persist build artifacts for deploy job
|
||||
- persist_to_workspace:
|
||||
root: workspace
|
||||
paths:
|
||||
- windows.zip
|
||||
|
||||
# Upload builds to S3
|
||||
deploy:
|
||||
docker:
|
||||
- image: circleci/python:3.7-stretch
|
||||
steps:
|
||||
# Access build artifacts in workspace
|
||||
- attach_workspace:
|
||||
at: workspace
|
||||
|
||||
# Set environment variables for nightly build name
|
||||
- run:
|
||||
name: Environment vars
|
||||
command: |
|
||||
echo 'export SHORT_GIT_HASH=$(echo $CIRCLE_SHA1 | cut -c -7)' >> $BASH_ENV
|
||||
echo 'export BUILD_ID=$(date +"%Y-%m-%d")_${SHORT_GIT_HASH}' >> $BASH_ENV
|
||||
echo 'export NUM_BUILDS=27' >> $BASH_ENV
|
||||
|
||||
# Install AWS CLI
|
||||
- run:
|
||||
name: Install awscli
|
||||
command: sudo pip install awscli
|
||||
|
||||
- run:
|
||||
name: Sync with S3
|
||||
command: |
|
||||
mkdir -p builds
|
||||
aws s3 sync s3://ruffle-rs/builds builds
|
||||
|
||||
- run:
|
||||
name: Check if stale build
|
||||
command: |
|
||||
# Check if files exist with this Git commit ID.
|
||||
# If so, this isn't a new commit, so cancel the deployment.
|
||||
if ls builds/linux/*${SHORT_GIT_HASH}.tar.gz 1> /dev/null 2>&1; then
|
||||
echo "No new commits; cancelling deploy"
|
||||
circleci-agent step halt
|
||||
fi
|
||||
|
||||
- run:
|
||||
name: Deploy to S3
|
||||
command: |
|
||||
rm -f builds/web-demo/*.wasm
|
||||
rm -f builds/web-demo/*.js
|
||||
rm -f builds/web-demo/*.html
|
||||
mkdir -p builds/linux
|
||||
cp -f workspace/linux.tar.gz builds/linux/ruffle_linux_latest.tar.gz
|
||||
cp -f workspace/linux.tar.gz builds/linux/ruffle_linux_${BUILD_ID}.tar.gz
|
||||
mkdir -p builds/osx
|
||||
cp -f workspace/osx.tar.gz builds/osx/ruffle_osx_latest.tar.gz
|
||||
cp -f workspace/osx.tar.gz builds/osx/ruffle_osx_${BUILD_ID}.tar.gz
|
||||
mkdir -p builds/windows
|
||||
cp -f workspace/windows.zip builds/windows/ruffle_windows_latest.zip
|
||||
cp -f workspace/windows.zip builds/windows/ruffle_windows_${BUILD_ID}.zip
|
||||
mkdir -p builds/web
|
||||
cp -f workspace/web.zip builds/web/ruffle_web_latest.zip
|
||||
cp -f workspace/web.zip builds/web/ruffle_web_${BUILD_ID}.zip
|
||||
mkdir -p builds/extension
|
||||
cp -f workspace/extension.zip builds/extension/ruffle_extension_latest.zip
|
||||
cp -f workspace/extension.zip builds/extension/ruffle_extension_${BUILD_ID}.zip
|
||||
mkdir -p builds/firefox_extension
|
||||
cp -f workspace/firefox_unsigned.xpi builds/firefox_extension/ruffle_firefox_latest.xpi
|
||||
cp -f workspace/firefox_unsigned.xpi builds/firefox_extension/ruffle_firefox_${BUILD_ID}.xpi
|
||||
|
||||
# Only keep a certain # of builds.
|
||||
ls -1t builds/linux/* | tail -n +${NUM_BUILDS} | xargs rm -f
|
||||
ls -1t builds/osx/* | tail -n +${NUM_BUILDS} | xargs rm -f
|
||||
ls -1t builds/windows/* | tail -n +${NUM_BUILDS} | xargs rm -f
|
||||
ls -1t builds/web/* | tail -n +${NUM_BUILDS} | xargs rm -f
|
||||
ls -1t builds/extension/* | tail -n +${NUM_BUILDS} | xargs rm -f
|
||||
ls -1t builds/firefox_extension/* | tail -n +${NUM_BUILDS} | xargs rm -f
|
||||
|
||||
# Copy over web demo.
|
||||
cp -rf workspace/web-demo builds
|
||||
|
||||
# Upload to S3.
|
||||
# S3 currently gives .wasm files the wrong MIME type, so have to upload that separately.
|
||||
aws s3 sync builds s3://ruffle-rs/builds --acl public-read --exclude '*.wasm' --delete
|
||||
aws s3 sync builds s3://ruffle-rs/builds --acl public-read --exclude '*' --include '*.wasm' --delete --content-type 'application/wasm'
|
||||
|
||||
# By default, S3 serves
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
||||
# Nightly builds
|
||||
nightly_build:
|
||||
triggers:
|
||||
- schedule:
|
||||
cron: "0 0 * * *"
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
jobs:
|
||||
- build
|
||||
- build_osx
|
||||
- build_windows
|
||||
- deploy:
|
||||
requires:
|
||||
- build
|
||||
- build_osx
|
||||
- build_windows
|
|
@ -5,9 +5,6 @@
|
|||
<a href="https://github.com/ruffle-rs/ruffle/actions">
|
||||
<img src="https://img.shields.io/github/workflow/status/ruffle-rs/ruffle/Test%20Rust?label=github%20actions%20rust%20build" alt="Rust Build Status" />
|
||||
<img src="https://img.shields.io/github/workflow/status/ruffle-rs/ruffle/Test%20Web?label=github%20actions%20web%20build" alt="Web Build Status" />
|
||||
</a>
|
||||
<a href="https://circleci.com/gh/ruffle-rs/ruffle">
|
||||
<img src="https://img.shields.io/circleci/build/github/ruffle-rs/ruffle?label=circleci%20build" alt="Travis Build Status" />
|
||||
</a>
|
||||
<a href="https://discord.gg/J8hgCQN">
|
||||
<img src="https://img.shields.io/discord/610531541889581066" alt="Ruffle Discord">
|
||||
|
|
Loading…
Reference in New Issue