diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 0000000..27a6376 --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,36 @@ +name: Release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +jobs: + release-plz: + name: Release-plz + if: ${{ github.repository_owner == 'rustic-rs' }} + runs-on: ubuntu-latest + steps: + - name: Generate GitHub token + uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1 + id: generate-token + with: + app-id: ${{ secrets.RELEASE_PLZ_APP_ID }} + private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }} + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + with: + fetch-depth: 0 + token: ${{ steps.generate-token.outputs.token }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Run release-plz + uses: MarcoIeni/release-plz-action@f7caa3f8c6302301514192fd4a83c4c56ee793a6 # v0.5 + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml deleted file mode 100644 index a495fce..0000000 --- a/.github/workflows/release-pr.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Open a release PR -on: - workflow_dispatch: - inputs: - crate: - description: Crate to release - required: true - type: choice - options: - - rustic_server - version: - description: Version to release - required: true - type: string - -jobs: - make-release-pr: - if: ${{ github.repository_owner == 'rustic-rs' }} - permissions: - id-token: write # Enable OIDC - pull-requests: write - contents: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: chainguard-dev/actions/setup-gitsign@main - - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2 - - name: Install cargo-release - uses: taiki-e/install-action@d211c4be5a95cbcd52a0870dda7d63a107a58368 # v2 - with: - tool: cargo-release - - uses: cargo-bins/release-pr@deeacca5a38bacc74a3f444b798f4b9bba40f6ad # v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - version: ${{ inputs.version }} - crate-name: ${{ inputs.crate }} - check-semver: true diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 0000000..bc6b820 --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,9 @@ +# configuration spec can be found here https://release-plz.ieni.dev/docs/config + +[workspace] +pr_draft = true +dependencies_update = true +# changelog_config = "cliff.toml" # Don't use this for now, as it will override the default changelog config + +[changelog] +protect_breaking_commits = true diff --git a/release.toml b/release.toml deleted file mode 100644 index f082b22..0000000 --- a/release.toml +++ /dev/null @@ -1,16 +0,0 @@ -pre-release-hook = [ - "git-cliff", - "-l", - "-o", - "CHANGELOG.md", - "--tag", - "{{version}}", -] - -pre-release-replacements = [ - { file = "CHANGELOG.md", search = "Unreleased", replace = "{{version}}" }, - { file = "CHANGELOG.md", search = "\\.\\.\\.HEAD", replace = "...{{tag_name}}", exactly = 1 }, - { file = "CHANGELOG.md", search = "ReleaseDate", replace = "{{date}}" }, - { file = "CHANGELOG.md", search = "", replace = "\n\n## [Unreleased] - ReleaseDate", exactly = 1 }, - { file = "CHANGELOG.md", search = "", replace = "\n[Unreleased]: https://github.com/rustic-rs/rustic_server/compare/{{tag_name}}...HEAD", exactly = 1 }, -]