refactor: collect all styles into Theme #218
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: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
paths: | |
- 'src/**' | |
- '.github/workflows/**' | |
- Cargo.lock | |
- Makefile.toml | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
arch: [amd64, arm64] | |
exclude: | |
- os: windows-latest | |
arch: arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache | |
if: ${{ !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }} | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./target | |
~/.cargo | |
key: ci-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('./Cargo.lock') }} | |
restore-keys: | | |
ci-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('./Cargo.lock') }} | |
- name: Docker Cache | |
uses: ScribeMD/[email protected] | |
with: | |
key: docker-${{ matrix.arch }} | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cross, cargo-make, cargo-deb | |
- name: Test | |
if: ${{ matrix.arch == 'amd64' }} | |
run: | | |
cargo make ci | |
- name: Build | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
run: cargo make release_${{ matrix.arch }} | |
- name: upload artifacts | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Artifacts-${{ runner.os }}-${{ matrix.arch }} | |
path: artifacts | |
retention-days: 5 | |
release: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && ( startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master') )}} | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: ./artifacts | |
- name: Tag as Continuous Integration | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
echo 'TAG=Continuous_Integration' >> $GITHUB_ENV | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ env.TAG }} | |
generate_release_notes: true | |
draft: ${{ startsWith(github.ref, 'refs/tags/') }} | |
prerelease : ${{ !startsWith(github.ref, 'refs/tags/') }} | |
files: | | |
artifacts/* |