Skip to content

Commit

Permalink
chore: 修改CI,支持生成release (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
nashaofu committed Feb 1, 2024
1 parent 11c02d1 commit d0cfffa
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
20 changes: 20 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
categories:
- title: "🚀 Features"
labels:
- "feature"
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
- title: "🧰 Maintenance"
label: "chore"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
template: |
## Changes
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
26 changes: 19 additions & 7 deletions .github/workflows/lint.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Lint
name: CI

on:
push:
branches:
- master
tags-ignore:
- "**"
pull_request: null
tags:
- v*.*.*

pull_request:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -44,6 +47,7 @@ jobs:
publish:
name: Publish
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
needs:
- lint
steps:
Expand All @@ -56,8 +60,16 @@ jobs:
override: true
components: rustfmt, clippy

- name: Release drafter
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
publish: true
name: ${{ github.ref_name }}
tag: ${{ github.ref_name }}

- name: Publish
if: github.event_name != 'pull_request'
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: cargo publish --registry crates-io --token $NPM_TOKEN
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --registry crates-io

0 comments on commit d0cfffa

Please sign in to comment.