Skip to content
Merged
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
53 changes: 12 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,19 @@ on:
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
check:
name: Check & Format
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Check formatting
run: cargo fmt --all -- --check

- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Check dependencies
run: cargo check --locked --all-targets

test:
name: Test
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Run tests
run: cargo test --locked --all
env:
RUST_LOG: trace
rust:
name: Rust CI
uses: muvon/ci-workflow/.github/workflows/rust-ci.yml@master
with:
# macOS-only app: jobs that compile the crate must run on macOS
runner: macos-15
feature-flags: '--all-features'
test-os: '["macos-15"]'
test-includes: '[]'
test-script: 'RUST_LOG=trace cargo test --locked --all'
doc: false
coverage: false

build:
name: Build (debug)
Expand Down
40 changes: 9 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- "*"
- '[0-9]+.[0-9]+.[0-9]+*' # Matches semver tags like 0.1.0, 1.0.0, etc.

env:
APP_NAME: Octoweb
Expand Down Expand Up @@ -89,41 +89,19 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
name: release-${{ matrix.arch }}
path: ${{ env.ARCHIVE_NAME }}
if-no-files-found: error

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

permissions:
contents: write

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Display structure
run: ls -laR artifacts/

- name: Create checksums file
run: |
cd artifacts
find . -name "*.tar.gz" -exec shasum -a 256 {} \; > checksums.txt
cat checksums.txt

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
files: |
artifacts/**/*.tar.gz
artifacts/**/checksums.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: muvon/ci-workflow/.github/workflows/release.yml@master
with:
artifacts: 'release-*'
draft: false

notify-homebrew:
name: Notify Homebrew Tap
Expand All @@ -136,4 +114,4 @@ jobs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.TAP_GITHUB_TOKEN }}" \
https://api.github.com/repos/muvon/homebrew-tap/dispatches \
-d "{\"event_type\":\"octoweb-release\",\"client_payload\":{\"version\":\"${{ github.ref_name }}\"}}"
-d "{\"event_type\":\"octoweb-release\",\"client_payload\":{\"version\":\"${{ needs.release.outputs.version }}\"}}"