Skip to content

Commit

Permalink
added publish pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kilork committed Jan 11, 2025
1 parent be6c059 commit fb6732e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/rust.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Rust
name: CI

on:
push:
tags:
- "v*"
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Build

runs-on: ubuntu-latest

Expand All @@ -30,3 +33,9 @@ jobs:
run: cargo build --no-default-features --features rustls
- name: Run tests with rustls
run: cargo test --no-default-features --features rustls
publish:
name: Publish
if: startsWith( github.ref, 'refs/tags/v' )
uses: ./.github/workflows/release.yml
needs: build
secrets: inherit
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to crates.io and draft release

on:
workflow_call:
secrets:
CRATES_TOKEN:
required: true

jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- run: |
cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
release:
name: Release on GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create a Release
uses: elgohr/Github-Release-Action@v5
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: ${{ github.ref }}
tag: ${{ github.ref }}

0 comments on commit fb6732e

Please sign in to comment.