From 7b3798a2657618b6546bfbdf69439f355919ac46 Mon Sep 17 00:00:00 2001 From: hozan23 <119854621+hozan23@users.noreply.github.com> Date: Fri, 15 Nov 2024 09:04:34 +0100 Subject: [PATCH] Automate deployment using release_plz (#78) --- .github/dependabot.yml | 4 +-- .github/workflows/release_plz.yml | 53 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release_plz.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d3895a7..c6d60de 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,8 +11,6 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" + interval: "weekly" commit-message: prefix: "chore(deps,github-actions)" - ignore: - - dependency-name: "dtolnay/rust-toolchain" diff --git a/.github/workflows/release_plz.yml b/.github/workflows/release_plz.yml new file mode 100644 index 0000000..3a8f3fd --- /dev/null +++ b/.github/workflows/release_plz.yml @@ -0,0 +1,53 @@ +name: Release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - 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 }}