From ce76bde171f44f0d608ac2f1a6a7b0a1c3b83b6e Mon Sep 17 00:00:00 2001 From: Thomas Versteeg Date: Wed, 25 Oct 2023 20:37:38 +0200 Subject: [PATCH] chore(ci): update and add auto-release --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/rust.yml | 28 ++++++++++++---------------- 2 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9e6ea30 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - master + +jobs: + release-plz: + name: Release PR + 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 80e24b8..5119436 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -4,10 +4,6 @@ on: paths-ignore: - "docs/**" - "**.md" - pull_request: - paths-ignore: - - "docs/**" - - "**.md" jobs: # Check for formatting @@ -15,7 +11,7 @@ jobs: name: Formatter check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: @@ -30,9 +26,9 @@ jobs: command: fmt args: --all -- --check - # Run compile check on Linux, macOS, and Windows - compile: - name: Compile + # Run test check on Linux, macOS, and Windows + test: + name: Test runs-on: ${{ matrix.os }} strategy: fail-fast: true @@ -40,7 +36,7 @@ jobs: os: [ubuntu-latest, macOS-latest, windows-latest] steps: # Checkout the branch being tested - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Install rust stable - uses: dtolnay/rust-toolchain@master @@ -48,23 +44,23 @@ jobs: toolchain: stable # Cache the built dependencies - - uses: Swatinem/rust-cache@v2.4.0 + - uses: Swatinem/rust-cache@v2.7.1 with: save-if: ${{ github.event_name == 'push' }} # Install cargo-hack - uses: taiki-e/install-action@cargo-hack - # Compile all feature combinations on the target platform - - name: Compile - run: cargo hack --feature-powerset check + # Test all feature combinations on the target platform + - name: Test + run: cargo hack --feature-powerset test # Build the WASM target & push it to GitHub pages wasm: - name: WASM build + name: WASM test & build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Install rust stable - uses: dtolnay/rust-toolchain@master @@ -73,7 +69,7 @@ jobs: targets: wasm32-unknown-unknown # Cache the built dependencies - - uses: Swatinem/rust-cache@v2.4.0 + - uses: Swatinem/rust-cache@v2.7.1 with: save-if: ${{ github.event_name == 'push' }}