name: Build
on:
pull_request:
push:
branches:
- main
tags:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run static checks
run: ci/run-static-checks
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-11
- 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: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build
run: ci/build-app
- 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@v2
- 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 }}