Skip to content

Commit

Permalink
Add CI to the project.
Browse files Browse the repository at this point in the history
Signed-off-by: ChenYing Kuo <[email protected]>
  • Loading branch information
evshary committed Nov 29, 2024
1 parent 888d90c commit 205ed92
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
changelog:
exclude:
labels:
- duplicate
- wontfix
- invalid
authors:
- octocat
categories:
- title: "🛠️ Breaking Changes"
labels:
- "breaking change"
- title: "✨ Features"
labels:
- enhancement
- title: "🐛 Bug Fixes"
labels:
- bug
- title: "📚 Documentation"
labels:
- documentation
- title: "Other Changes"
labels:
- "*"
29 changes: 29 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches:
- main
pull_request:
paths:
- "src/**"
- "tests/**"
- "examples/**"
- "Cargo.*"
- ".github/**"
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
markdown_lint:
runs-on: ubuntu-22.04
steps:
- uses: articulate/actions-markdownlint@v1
with:
config: .markdownlint.yaml
files: '*.md'
ignore: target
version: 0.28.1
56 changes: 56 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

on:
push:
tags:
- v*
workflow_dispatch:

concurrency:
group: "release-${{ github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
ci:
uses: ./.github/workflows/ci.yaml

tag_release_artifacts:
# This only runs if this workflow is initiated via a tag-push with pattern 'v*'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
name: collect v-tag release artifacts
runs-on: ubuntu-latest
needs:
- ci
permissions: write-all
steps:
- uses: actions/checkout@v4

# README - we later need the download_url output of the upload step
- name: Upload README to release
uses: svenstaro/upload-release-action@v2
id: upload_readme
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: README.md
tag: ${{ github.ref }}

- name: Gets latest created release info
id: latest_release_info
uses: joutvhu/get-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Collect all artifacts
uses: anotherdaniel/[email protected]
id: quevee_manifest
with:
release_url: ${{ steps.latest_release_info.outputs.html_url }}
artifacts_readme: ${{ steps.upload_readme.outputs.browser_download_url }}

- name: Upload manifest to release
uses: svenstaro/upload-release-action@v2
id: upload_quality_manifest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.quevee_manifest.outputs.manifest_file }}
tag: ${{ github.ref }}
5 changes: 5 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"MD013": false, # Line length limitation
"MD033": false, # Enable Inline HTML
"MD041": false, # Allow first line heading
}
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint

0 comments on commit 205ed92

Please sign in to comment.