From 6cf5d92cb8e07a8b6da384a92da8508918f97223 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Sun, 7 Jul 2024 09:52:51 -0500 Subject: [PATCH] chore: Switch to Gitea Actions. --- .drone.yml | 47 ------------------------------------ .gitea/workflows/release.yml | 39 ++++++++++++++++++++++++++++++ .gitea/workflows/test.yml | 37 ++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 47 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/release.yml create mode 100644 .gitea/workflows/test.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index cbafe62..0000000 --- a/.drone.yml +++ /dev/null @@ -1,47 +0,0 @@ -kind: pipeline -type: docker -name: default - -environment: - DEPENDENCIES: cmake pkg-config libx11-dev libasound2-dev libudev-dev libxcb-xfixes0-dev libwayland-dev libxkbcommon-dev libvulkan-dev libpulse-dev - -steps: - - name: test - image: rust:bullseye - pull: always - commands: - - apt-get update -qq - - apt-get install -qqy $DEPENDENCIES - - rustup component add clippy rustfmt - - cargo fmt --check - - cargo test - - cargo clippy - - name: release - image: rust:bullseye - pull: always - commands: - - apt-get update -qq - - apt-get install -qqy $DEPENDENCIES - - cargo publish - when: - ref: - - refs/tags/v* - environment: - CARGO_REGISTRY_TOKEN: - from_secret: cargo_registry_token - - name: discord notification - image: appleboy/drone-discord - when: - status: [success, failure] - settings: - webhook_id: - from_secret: discord_webhook_id - webhook_token: - from_secret: discord_webhook_token - tts: true - message: > - {{#success build.status}} - {{repo.name}} build {{build.number}} succeeded: <{{build.link}}> - {{else}} - {{repo.name}} build {{build.number}} failed: <{{build.link}}> - {{/success}} diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..8f95122 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy + - name: install Linux build dependencies + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libasound2-dev libudev-dev libwayland-dev libclang-dev cmake + if: runner.os == 'linux' + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 + - ame: Publish + run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..68e999b --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,37 @@ +name: Test + +on: + pull_request: + push: + +jobs: + test: + strategy: + matrix: + # os: [windows-latest, ubuntu-latest, macos-latest] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy + - name: install Linux build dependencies + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libasound2-dev libudev-dev libwayland-dev libclang-dev cmake + if: runner.os == 'linux' + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1