[Release] v0.7.2 #19
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
name: Release CodeSnap to crates.io | |
on: | |
push: | |
paths: | |
- core/Cargo.toml | |
- lib/Cargo.toml | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Read version from core project | |
id: read_toml | |
uses: SebRollen/[email protected] | |
with: | |
file: core/Cargo.toml | |
field: package.version | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: login | |
args: ${{ secrets.CRATES_TOKEN }} | |
- name: Publish library to crates.io | |
uses: actions-rs/cargo@v1 | |
with: | |
command: publish | |
args: --manifest-path core/Cargo.toml | |
- name: Publish cli to crates.io | |
uses: actions-rs/cargo@v1 | |
with: | |
command: publish | |
args: --manifest-path cli/Cargo.toml | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.PAT }} | |
custom_tag: ${{ steps.read_toml.outputs.value }} | |
- name: Build changelog for main repository | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v5 | |
with: | |
token: ${{ secrets.PAT }} | |
toTag: ${{ steps.tag_version.outputs.new_tag }} | |
configurationJson: | | |
{ | |
"categories": [ | |
{ | |
"title": "## What's Changed:", | |
"labels": [] | |
} | |
], | |
"pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in #{{URL}}", | |
"template": "#{{CHANGELOG}}\n\n**Full Changelog**: https://github.com/mistricky/CodeSnap/compare/#{{FROM_TAG}}...#{{TO_TAG}}" | |
} | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
token: ${{ secrets.PAT }} | |
body: | | |
## 👋 Hi, there! | |
Thanks for using CodeSnap! The most beautiful code screenshots tool, there are two ways to use CodeSnap: | |
Treat CodeSnap as library in your project by Cargo: | |
```bash | |
Cargo add codesnap | |
``` | |
Or use CodeSnap as CLI tool installed globally: | |
**Cargo** | |
```bash | |
Cargo install codesnap-cli | |
``` | |
**Homebrew** | |
```bash | |
brew install mistricky/tap/CodeSnap | |
``` | |
Of course, you can install CodeSnap manually by downloading the following binaries. | |
${{steps.build_changelog.outputs.changelog}} |