-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
73 additions
and
16 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
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,33 @@ | ||
name: Publish to crate.io | ||
|
||
on: | ||
push: | ||
tags: ["v*"] | ||
|
||
jobs: | ||
publish-crate: | ||
environment: crates-io | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install rust toolchain stable | ||
uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: x86_64-unknown-linux-gnu | ||
- name: Generate release context | ||
id: release_context | ||
run: | | ||
tag="$(git describe HEAD --abbrev=0)" | ||
echo "tag_name=$tag" >>$GITHUB_OUTPUT | ||
echo "version=${tag/v/}" >>$GITHUB_OUTPUT | ||
git log --pretty=format:'%b' --no-merges -1 >RELEASE_BODY.md | ||
- run: cargo publish | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Release ${{ steps.release_context.outputs.tag_name }} | ||
tag_name: ${{ steps.release_context.outputs.tag_name }} | ||
body_path: RELEASE_BODY.md |
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,27 @@ | ||
name: Create Rlease Tag | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
create-tag: | ||
environment: crates-io | ||
runs-on: ubuntu-latest | ||
if: ${{ startsWith(github.event.head_commit.message, 'chore(release):') }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_PAT }} | ||
- name: Setup git user | ||
run: | | ||
git config user.email "type.in.type@gmail.com" | ||
git config user.name "Takeru Sato" | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
- run: sudo npm install -g standard-version | ||
- name: Determine tag and generate release body | ||
run: standard-version --skip.changelog --skip.commit | ||
- name: Publish tag | ||
run: git push --follow-tags |