Skip to content

Commit

Permalink
ci: add release-please setup
Browse files Browse the repository at this point in the history
  • Loading branch information
loiccoyle committed Aug 15, 2024
1 parent 70c6a74 commit 92e048f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
14 changes: 14 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "rust",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,39 @@ jobs:
- name: Run tests
run: cargo test

release:
name: release
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'loiccoyle' }}
needs:
- test
outputs:
release_created: ${{ steps.release.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json

publish:
name: Publish to crates.io
needs:
- release
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install toolchain
run: rustup toolchain install stable --profile minimal

- uses: Swatinem/rust-cache@v2

- name: Publish crate
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}

readme:
runs-on: ubuntu-latest
needs: test
Expand Down
Empty file added CHANGELOG.md
Empty file.

0 comments on commit 92e048f

Please sign in to comment.