diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cdcad4b..559985c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 661c07f..9374a5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 }}\"}}"