workflow_refactor (#1)
All checks were successful
Release Tagging / release (push) Successful in 37s
Rust Build / Check (push) Successful in 47s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Check (pull_request) Successful in 32s
Rust Build / Test Suite (push) Successful in 50s
Rust Build / Clippy (push) Successful in 47s
Rust Build / build (push) Successful in 52s
Rust Build / Test Suite (pull_request) Successful in 33s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 28s
All checks were successful
Release Tagging / release (push) Successful in 37s
Rust Build / Check (push) Successful in 47s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Check (pull_request) Successful in 32s
Rust Build / Test Suite (push) Successful in 50s
Rust Build / Clippy (push) Successful in 47s
Rust Build / build (push) Successful in 52s
Rust Build / Test Suite (pull_request) Successful in 33s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 28s
Reviewed-on: #1 Co-authored-by: phoenix <kundeng94@gmail.com> Co-committed-by: phoenix <kundeng94@gmail.com>
This commit is contained in:
57
.gitea/workflows/tag_release.yml
Normal file
57
.gitea/workflows/tag_release.yml
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Release Tagging
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- devel
|
||||
tags:
|
||||
- 'v*' # Trigger on tags matching v*
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Important for git describe --tags
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.85.0
|
||||
components: cargo
|
||||
|
||||
- name: Extract Version from Cargo.toml
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(grep '^version = "' Cargo.toml | sed -E 's/version = "([^"]+)"/\1/')
|
||||
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
|
||||
BRANCH_REF="${GITHUB_REF}"
|
||||
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
|
||||
PROJECT_TAG_RELEASE="v$VERSION-$BRANCH_NAME-$PROJECT_COMMIT_HASH"
|
||||
echo "::set-output name=project_tag_release::$PROJECT_TAG_RELEASE-680"
|
||||
echo "Version: $VERSION"
|
||||
echo "Hash: $PROJECT_COMMIT_HASH"
|
||||
echo "Branch: $BRANCH_NAME"
|
||||
echo "Tag Release: $PROJECT_TAG_RELEASE"
|
||||
|
||||
- name: Print version
|
||||
id: Version
|
||||
run: |
|
||||
echo "Printing version"
|
||||
echo "Version: ${{ steps.version.outputs.project_tag_release }}"
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.version.outputs.project_tag_release }}
|
||||
release_name: Release ${{ steps.version.outputs.project_tag_release }}
|
||||
body: |
|
||||
Release of version ${{ steps.version.outputs.project_tag_release }}
|
||||
# draft: false
|
||||
# prerelease: ${{ startsWith(github.ref, 'v') == false }} # prerelease if not a valid release tag
|
||||
|
104
.gitea/workflows/workflow.yml
Normal file
104
.gitea/workflows/workflow.yml
Normal file
@@ -0,0 +1,104 @@
|
||||
name: Rust Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- devel
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- devel
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.85.0
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
|
||||
chmod 600 ~/.ssh/gitlab_deploy_key
|
||||
ssh-keyscan ${{ vars.MYHOST }} >> ~/.ssh/known_hosts
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/gitlab_deploy_key
|
||||
cargo check
|
||||
|
||||
test:
|
||||
name: Test Suite
|
||||
runs-on: ubuntu-24.04
|
||||
needs: setup_ssh
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.85.0
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
|
||||
chmod 600 ~/.ssh/gitlab_deploy_key
|
||||
ssh-keyscan ${{ vars.MYHOST }} >> ~/.ssh/known_hosts
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/gitlab_deploy_key
|
||||
cargo test
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-24.04
|
||||
needs: setup_ssh
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.85.0
|
||||
- run: rustup component add rustfmt
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
|
||||
chmod 600 ~/.ssh/gitlab_deploy_key
|
||||
ssh-keyscan ${{ vars.MYHOST }} >> ~/.ssh/known_hosts
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/gitlab_deploy_key
|
||||
cargo fmt --all -- --check
|
||||
|
||||
clippy:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-24.04
|
||||
needs: setup_ssh
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.85.0
|
||||
- run: rustup component add clippy
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
|
||||
chmod 600 ~/.ssh/gitlab_deploy_key
|
||||
ssh-keyscan ${{ vars.MYHOST }} >> ~/.ssh/known_hosts
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/gitlab_deploy_key
|
||||
cargo clippy -- -D warnings
|
||||
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-24.04
|
||||
needs: setup_ssh
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.85.0
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
|
||||
chmod 600 ~/.ssh/gitlab_deploy_key
|
||||
ssh-keyscan ${{ vars.MYHOST }} >> ~/.ssh/known_hosts
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/gitlab_deploy_key
|
||||
cargo build --release
|
||||
|
Reference in New Issue
Block a user