Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] create github action to release codesnap to crate.io #2

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/release-lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release CodeSnap to crates.io

on:
push:
paths:
core/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

- name: Foo
run: "echo ${{ steps.read_toml.outputs.value }}"

- uses: actions-rs/cargo@v1
working-directory: core
with:
command: publish
args: --manifest-path core/Cargo.toml

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: v${{ steps.read_toml.outputs.value }}

- 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 }}
generateReleaseNotes: true
Loading