Skip to content
Merged
Changes from 1 commit
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
45 changes: 44 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
on: [push, pull_request]
on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., v0.8.0)'
required: true
type: string
name: Continuous integration
jobs:
default-features:
Expand Down Expand Up @@ -87,3 +99,34 @@
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo audit

release:
name: Create Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
needs: [default-features, test, clippy, audit]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag || github.ref }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build release binary
run: cargo build --release
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG_NAME="${{ github.event.inputs.tag }}"
else
TAG_NAME=${GITHUB_REF#refs/tags/}
fi
gh release create "$TAG_NAME" \
--title "Release $TAG_NAME" \
--notes "See [CHANGELOG](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details." \
--draft=false \
--prerelease=false
Comment thread Fixed
Loading