Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Brainstorming #2

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 14 additions & 23 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,24 @@ on:
- main

env:
CARGO_INCREMENTAL: 1
CARGO_TERM_COLOR: always

GITHUB_CACHE_VERSION: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache

SCCACHE_LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
SCCACHE_DIR: /home/runner/.cache/sccache

jobs:
cargo_checks:
cargo-checks:
name: Task cargo ${{ matrix.action }}
runs-on: ubuntu-latest
strategy:
matrix:
action: [clippy, nextest]
action: [clippy, fmt, nextest]
steps:
- name: Fetch latest code
uses: actions/checkout@v3
- name: Install Sccache
run: |
export SCCACHE_FILE=sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl
curl -L ${{ env.SCCACHE_LINK }}/${{ env.SCCACHE_VERSION }}/$SCCACHE_FILE.tar.gz | tar xz
sudo mv $SCCACHE_FILE/sccache /usr/bin
sudo chmod u+x /usr/bin/sccache
- name: Cache cargo
uses: actions/cache@v3
with:
Expand All @@ -45,24 +35,25 @@ jobs:
target
key: cargo-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}-
- name: Cache sccache
uses: actions/cache@v3
with:
path: ${{ env.SCCACHE_DIR}}
key: sccache-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}--${{ hashFiles('**/Cargo.lock') }}
restore-keys: sccache-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}-
- name: Cargo ${{ matrix.action }}
if: matrix.action == 'clippy'
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-features --all-targets --locked
- name: Cargo ${{ matrix.action }}
if: matrix.action == 'fmt'
run: cargo ${{ matrix.action }} --all -- --check
- name: Install cargo-nextest
if: matrix.action == 'nextest'
uses: taiki-e/install-action@nextest
- name: Cargo nextest
- name: Cargo ${{ matrix.action }}
if: matrix.action == 'nextest'
uses: actions-rs/cargo@v1
run: cargo ${{ matrix.action }} run --release --workspace --all-features --all-targets --locked
- name: Fast fail
uses: vishnudxb/[email protected]
if: failure()
with:
command: nextest
args: run --workspace --all-features --all-targets --locked
repo: hack-ink/subapeye
workflow_id: ${{ github.run_id }}
access_token: ${{ github.token }}
82 changes: 9 additions & 73 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,24 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build ${{ matrix.target.name }} package
runs-on: ${{ matrix.target.os }}
strategy:
matrix:
target:
[
{ name: x86_64-unknown-linux-gnu, os: ubuntu-latest },
{ name: aarch64-apple-darwin, os: macos-latest },
{ name: x86_64-apple-darwin, os: macos-latest },
{
name: x86_64-pc-windows-msvc,
os: windows-latest,
extension: .exe,
},
]
steps:
- name: Fetch latest code
uses: actions/checkout@v3
- name: Setup Rust toolchain
run: rustup target add ${{ matrix.target.name }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target ${{ matrix.target.name }}
- name: Compress
run: |
mv target/${{ matrix.target.name }}/release/<NAME>${{ matrix.target.extension }} .
zstd --ultra -22 -o <NAME>-${{ matrix.target.name }}.zst <NAME>${{ matrix.target.extension }}
- name: Collect artifact
run: |
mkdir -p artifacts
mv <NAME>-${{ matrix.target.name }}.zst artifacts
- name: Upload artifact
uses: actions/[email protected]
with:
name: artifacts
path: artifacts

release:
name: Release
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: artifacts
path: artifacts
- name: Hash
run: |
cd artifacts
sha256sum * | tee ../SHA256
md5sum * | tee ../MD5
mv ../SHA256 .
mv ../MD5 .
- name: Publish
uses: softprops/action-gh-release@v1
with:
discussion_category_name: Announcements
generate_release_notes: true
files: artifacts/*

# publish-on-crates-io:
# name: Publish on crates.io
# runs-on: ubuntu-latest
# steps:
# - name: Fetch latest code
# uses: actions/checkout@v3
# - name: Login
# run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
# - name: Publish
# run: .maintain/release.sh

clean-artifacts:
name: Clean artifacts
if: always()
needs: [release]
steps:
- name: Clean artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: artifacts
publish-on-crates-io:
name: Publish on crates.io
runs-on: ubuntu-latest
steps:
- name: Fetch latest code
uses: actions/checkout@v3
- name: Login
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish
run: cargo publish --locked
87 changes: 0 additions & 87 deletions .github/workflows/staging.yml

This file was deleted.

Loading