added gitea ci
This commit is contained in:
@@ -2,6 +2,8 @@ name: Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
@@ -18,6 +20,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
|
- name: Get Version
|
||||||
|
id: get_version
|
||||||
|
run: |
|
||||||
|
VERSION=$(grep '^version =' Cargo.toml | head -n1 | cut -d '"' -f 2)
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||||
|
echo "TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "TAG=v$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release
|
run: cargo build --release
|
||||||
|
|
||||||
@@ -27,8 +40,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref_name }}
|
tag_name: ${{ steps.get_version.outputs.TAG }}
|
||||||
release_name: Release ${{ github.ref_name }}
|
release_name: Release ${{ steps.get_version.outputs.TAG }}
|
||||||
|
body: |
|
||||||
|
Automated release for version ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
Commit: ${{ github.sha }}
|
||||||
|
Branch: ${{ github.ref_name }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
@@ -39,5 +56,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_path: ./target/release/cenv
|
asset_path: ./target/release/cenv
|
||||||
asset_name: cenv-${{ github.ref_name }}-linux-amd64
|
asset_name: cenv-${{ steps.get_version.outputs.TAG }}-linux-amd64
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|||||||
Reference in New Issue
Block a user