chore: change ci/cd to use github and deploy with cd from now
Rust CI / cargo CI (push) Waiting to run Details
Release-plz / Release-plz release (push) Waiting to run Details
Release-plz / Release-plz PR (push) Waiting to run Details

This commit is contained in:
Christoph J. Scherr 2024-10-16 20:29:22 +02:00
parent 2f306304b3
commit 4a9eac6091
3 changed files with 75 additions and 9 deletions

7
.github/dependabot.yaml vendored Normal file
View File

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates every Monday
schedule:
interval: "weekly"

View File

@ -1,12 +1,19 @@
name: cargo devel CI name: Rust CI
on: on:
pull_request:
branches:
- '**'
push: push:
branches: branches:
- '**' - '**'
# - '!master' # - '!master'
env:
CARGO_TERM_COLOR: always
jobs: jobs:
format: CI:
runs-on: ubuntu-latest
name: cargo CI name: cargo CI
permissions: permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the # Give the default GITHUB_TOKEN write permission to commit and push the
@ -16,15 +23,11 @@ jobs:
- name: get repo - name: get repo
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: install rust - name: install rust
uses: https://github.com/dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
- name: install additional rust things - name: install additional rust things
run: | run: |
rustup component add rustfmt rustup component add rustfmt
rustup component add clippy rustup component add clippy
- name: install additional system dependencies
run: |
apt update
apt install libdbus-1-dev libasound2-dev -y
- name: config custom registry - name: config custom registry
run: | run: |
mkdir -p ~/.cargo/ mkdir -p ~/.cargo/
@ -40,9 +43,11 @@ jobs:
run: cargo clippy --fix --all-features --all-targets --workspace run: cargo clippy --fix --all-features --all-targets --workspace
- name: cargo fmt - name: cargo fmt
run: cargo fmt --all run: cargo fmt --all
- name: cargo test
run: cargo test --all-features --all-targets --workspace
- name: commit back to repository - name: commit back to repository
uses: https://github.com/stefanzweifel/git-auto-commit-action@v5 uses: stefanzweifel/git-auto-commit-action@v5
with: with:
# Optional. Commit message for the created commit. # Optional. Commit message for the created commit.
# Defaults to "Apply automatic changes" # Defaults to "Apply automatic changes"
commit_message: automatic cargo CI changes commit_message: "ci: automatic Rust CI changes"

54
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,54 @@
name: Release-plz
permissions:
pull-requests: write
contents: write
on:
push:
branches:
- master
- main
jobs:
# Release unpublished packages.
release-plz-release:
name: Release-plz release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
name: Release-plz PR
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}