fix ci #7
This file contains hidden or 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: doas | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| branches: ["master"] | |
| pull_request: | |
| branches: ["master"] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: write | |
| jobs: | |
| build_on_macos: | |
| name: build on macOS | |
| runs-on: macos-15 | |
| steps: | |
| - name: Pull code | |
| uses: actions/checkout@v5 | |
| - name: Install rustfmt | |
| run: rustup component add --toolchain nightly-aarch64-apple-darwin rustfmt | |
| - name: Install Miri | |
| run: rustup component add --toolchain nightly-aarch64-apple-darwin miri | |
| - name: Check format | |
| run: cargo fmt --check | |
| - name: Build for macOS | |
| run: cargo build --release | |
| - name: Rename binary for Release | |
| if: github.event_name == 'release' | |
| run: cp target/release/doas doas-${{ github.ref_name }}-aarch64-apple-darwin | |
| - name: Upload the build artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: aarch64-apple-darwin | |
| path: target/release/doas | |
| - name: Build for macOS (with apple-auth) | |
| run: cargo build --release --features apple-auth | |
| - name: Rename binary for Release | |
| if: github.event_name == 'release' | |
| run: cp target/release/doas "doas-${{ github.ref_name }}-aarch64-apple-darwin(apple-auth)" | |
| - name: Upload the build artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: aarch64-apple-darwin(apple-auth) | |
| path: target/release/doas | |
| - name: Run tests | |
| run: cargo test && cargo +nightly miri test | |
| - name: Upload macOS binary to Release | |
| uses: softprops/action-gh-release@v3 | |
| if: github.event_name == 'release' | |
| with: | |
| files: | | |
| doas-${{ github.ref_name }}-aarch64-apple-darwin | |
| doas-${{ github.ref_name }}-aarch64-apple-darwin(apple-auth) | |
| build_on_linux: | |
| name: build on Linux | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Pull code | |
| uses: actions/checkout@v5 | |
| - name: Install PAM development libraries | |
| run: sudo apt-get update && sudo apt-get install -y libpam0g-dev | |
| - name: Install rustfmt | |
| run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt | |
| - name: Install Miri | |
| run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu miri | |
| - name: Check format | |
| run: cargo fmt --check | |
| - name: Build for Linux | |
| run: cargo build --release | |
| - name: Upload the build artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: x86_64_linux-gnu | |
| path: target/release/doas | |
| - name: Run tests | |
| run: cargo test && cargo +nightly miri test | |
| - name: Rename binary for Release | |
| if: github.event_name == 'release' | |
| run: cp target/release/doas doas-${{ github.ref_name }}-x86_64-unknown-linux-gnu | |
| - name: Upload Linux binary to Release | |
| uses: softprops/action-gh-release@v3 | |
| if: github.event_name == 'release' | |
| with: | |
| files: doas-${{ github.ref_name }}-x86_64-unknown-linux-gnu |