diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 0a32057..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Publish to crates.io - -on: - push: - tags: ["v*"] - -jobs: - generate-release: - runs-on: ubuntu-latest - steps: - - name: Install markdown-extract - shell: bash - run: cargo install markdown-extract - - uses: actions/checkout@v3 - - name: Generate changelog - shell: bash - run: markdown-extract --no-print-matched-heading "${{ github.ref_name }}" CHANGELOG.md > release-text.md - - name: Make GitHub release - uses: softprops/action-gh-release@v1 - with: - draft: true - body_path: ${{ github.workspace }}/release-text.md - - publish-crates: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@1.72.1 - - name: Publish crate - uses: katyo/publish-crates@v2 - with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - publish-release: - needs: [generate-release, publish-crates] - permissions: - contents: write - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v3 - - name: mark release as non-draft - run: | - gh release edit ${{ github.ref_name }} --draft=false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..103bc64 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +jobs: + release-plz: + name: Release-plz + runs-on: ubuntu-latest + steps: + - name: Generate GitHub token + uses: actions/create-github-app-token@v1 + id: generate-token + with: + app-id: ${{ secrets.RELEASE_APP_ID }} + private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + - 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: ${{ steps.generate-token.outputs.token }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1b5e7ca..0c160a2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: Rust +name: rust on: push: