name: Build
on:
pull_request:
push:
branches:
- main
tags:
- '[0-9]*'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Run static checks
run: ci/run-static-checks
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-11
- macos-14
- windows-2019
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix actions/checkout bug
run: git fetch --force --tags
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Build
run: ci/build-app
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Force bash binary (Windows)
if: matrix.os == 'windows-2019'
run: echo "BASH_CMD=c:/program files/git/bin/bash.exe" >> $GITHUB_ENV
- name: Run tests
run: ci/run-tests
- name: Create archive
run: ci/create-archive
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
artifacts/*.gz
artifacts/*.zip
server-upload:
needs:
- lint
- build
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: artifacts
path: artifacts
- name: Upload to builds.agateau.com
run: ci/upload-build clyde artifacts/*.gz artifacts/*.zip
env:
UPLOAD_USERNAME: ${{ secrets.UPLOAD_USERNAME }}
UPLOAD_PRIVATE_KEY: ${{ secrets.UPLOAD_PRIVATE_KEY }}
UPLOAD_HOSTNAME: ${{ secrets.UPLOAD_HOSTNAME }}