-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: prepare for automatic release (#27)
Signed-off-by: YUE Daian <[email protected]>
- Loading branch information
Showing
21 changed files
with
324 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: 'Lint PR' | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
id: lint_pr_title | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
# When the previous steps fails, the workflow would stop. By adding this | ||
# condition you can continue the execution with the populated error message. | ||
if: always() && (steps.lint_pr_title.outputs.error_message != null) | ||
with: | ||
header: pr-title-lint-error | ||
message: | | ||
Hey there and thank you for opening this pull request! 👋🏼 | ||
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. | ||
Details: | ||
``` | ||
${{ steps.lint_pr_title.outputs.error_message }} | ||
``` | ||
# Delete a previous comment when the issue has been resolved | ||
- if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: pr-title-lint-error | ||
delete: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This workflow creates a running release please PR, which tracks all changes | ||
# based on semantic PR titles. When that PR is merged, a publish occurs after | ||
# release please increments the version. | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
name: Run Release Please | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
release-please: | ||
permissions: | ||
contents: write # for google-github-actions/release-please-action to create release commit | ||
pull-requests: write # for google-github-actions/release-please-action to create release PR | ||
runs-on: ubuntu-latest | ||
|
||
# Release-please creates a PR that tracks all changes | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
command: manifest | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
default-branch: main | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
release_tag_name: ${{ steps.release.outputs.tag_name }} | ||
|
||
cargo-publish: | ||
needs: release-please | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.release-please.outputs.release_created }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ needs.release-please.outputs.release_tag_name }} | ||
|
||
- name: Publish | ||
run: | | ||
cargo publish | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ ".": "0.1.0" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"packages": { | ||
".": { | ||
"release-type": "rust", | ||
"prerelease": false, | ||
"bump-minor-pre-major": true, | ||
"bump-patch-for-minor-pre-major": true, | ||
"extra-files": ["README.md"], | ||
"changelog-sections": [ | ||
{ | ||
"type": "fix", | ||
"section": "🐛 Bug Fixes" | ||
}, | ||
{ | ||
"type": "feat", | ||
"section": "✨ New Features" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "🧹 Chore" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "📚 Documentation" | ||
}, | ||
{ | ||
"type": "perf", | ||
"section": "🚀 Performance" | ||
}, | ||
{ | ||
"type": "build", | ||
"hidden": true, | ||
"section": "🛠️ Build" | ||
}, | ||
{ | ||
"type": "deps", | ||
"section": "📦 Dependencies" | ||
}, | ||
{ | ||
"type": "ci", | ||
"hidden": true, | ||
"section": "🚦 CI" | ||
}, | ||
{ | ||
"type": "refactor", | ||
"section": "🔄 Refactoring" | ||
}, | ||
{ | ||
"type": "revert", | ||
"section": "🔙 Reverts" | ||
}, | ||
{ | ||
"type": "style", | ||
"hidden": true, | ||
"section": "🎨 Styling" | ||
}, | ||
{ | ||
"type": "test", | ||
"hidden": true, | ||
"section": "🧪 Tests" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.