Compare commits
2 Commits
daffc65039
...
6eddd02fb4
| Author | SHA1 | Date | |
|---|---|---|---|
| 6eddd02fb4 | |||
| 93b2b82494 |
@@ -2,6 +2,8 @@ name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
@@ -18,6 +20,17 @@ jobs:
|
||||
with:
|
||||
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
|
||||
run: cargo build --release
|
||||
|
||||
@@ -27,8 +40,12 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
release_name: Release ${{ github.ref_name }}
|
||||
tag_name: ${{ steps.get_version.outputs.TAG }}
|
||||
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
|
||||
prerelease: false
|
||||
|
||||
@@ -39,5 +56,5 @@ jobs:
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user