Skip to content

feat(cli): statusline schema alignment and UX #17

feat(cli): statusline schema alignment and UX

feat(cli): statusline schema alignment and UX #17

Workflow file for this run

name: release
on:
push:
tags: ['v*']
permissions:
id-token: write
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Check & Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy -- -D warnings
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --verbose
build:
name: Build (${{ matrix.target }})
needs: [check, test]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
asset: great-linux-x86_64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
asset: great-linux-aarch64
- target: x86_64-apple-darwin
os: macos-latest
asset: great-macos-x86_64
- target: aarch64-apple-darwin
os: macos-latest
asset: great-macos-aarch64
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Set version from tag
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i.bak "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
rm -f Cargo.toml.bak
- name: Build
run: cargo build --release --target ${{ matrix.target }}
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- name: Rename binary
run: cp target/${{ matrix.target }}/release/great ${{ matrix.asset }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset }}
path: ${{ matrix.asset }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Collect binaries
run: |
mkdir -p release
for dir in artifacts/great-*; do
name=$(basename "$dir")
cp "$dir/$name" "release/$name"
chmod +x "release/$name"
done
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: release/*
deploy-site:
name: Deploy Site
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm --filter great-sh build
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::756605216505:role/great-sh-deploy
aws-region: us-east-1
- name: Deploy assets
run: |
aws s3 sync site/dist/assets s3://great.sh-cloudfront/assets \
--cache-control "public,max-age=31536000,immutable"
- name: Deploy HTML
run: |
aws s3 sync site/dist s3://great.sh-cloudfront \
--exclude "assets/*" \
--cache-control "no-cache" \
--delete
- name: Invalidate CloudFront
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ vars.CLOUDFRONT_DISTRIBUTION_ID }} \
--paths "/*"