Merge pull request #203 from agateau/prep-release #525
Workflow file for this run
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: | |
pull_request: | |
push: | |
branches: | |
# Only build on pushes to the main branch, otherwise branches pushed for PR | |
# are built twice | |
- 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 | |
# Intel-based | |
- macos-11 | |
# ARM-based | |
- macos-14 | |
- windows-2019 | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Use `fetch-depth: 0` otherwise `git describe` does not see valid | |
# tags, causing ci/create-archive to create snapshot archives. This | |
# also requires the "Fix actions/checkout bug" step below to work. | |
fetch-depth: 0 | |
# See https://github.com/actions/checkout/issues/290#issuecomment-680260080 | |
- 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 | |
# Python is used by functional tests | |
- 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 }} |