Skip to content

Commit

Permalink
Publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Sep 10, 2024
1 parent fa7fb7d commit 15b5698
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/publish-dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PublishDryRun

on:
workflow_dispatch

env:
rust_toolchain: stable

jobs:
publishdryrun:
name: Publish Dry Run
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_toolchain }}
- name: Setup | Set toolchain
run: rustup default ${{ env.rust_toolchain }}
- name: Build | Publish Dry Run
run: cargo publish --dry-run
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish

on:
workflow_dispatch

env:
rust_toolchain: stable
CRATE_NAME: async-io-mini

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_toolchain }}
- name: Setup | Set toolchain
run: rustup default ${{ env.rust_toolchain }}
- name: Login
run: cargo login ${{ secrets.crates_io_token }}
- name: Build | Publish
run: cargo publish
- name: Get the crate version from cargo
run: |
version=$(cargo metadata --format-version=1 --no-deps | jq -r ".packages[] | select(.name == \"${{env.CRATE_NAME}}\") | .version")
echo "crate_version=$version" >> $GITHUB_ENV
echo "${{env.CRATE_NAME}} version: $version"
- name: Tag the new release
uses: rickstaa/action-create-tag@v1
with:
tag: v${{env.crate_version}}
message: "Release v${{env.crate_version}}"

0 comments on commit 15b5698

Please sign in to comment.