2024-01-08 20:42:21 +00:00
|
|
|
name: Release binary for cl-cli
|
|
|
|
|
2024-01-08 20:40:38 +00:00
|
|
|
on:
|
|
|
|
push
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-release:
|
|
|
|
runs-on: ubuntu-latest
|
2024-01-08 20:45:01 +00:00
|
|
|
steps:
|
2024-01-08 21:01:48 +00:00
|
|
|
- name: Checkout repository
|
2024-01-08 20:40:38 +00:00
|
|
|
uses: https://github.com/actions/checkout@v4
|
2024-01-08 21:01:48 +00:00
|
|
|
- name: Install rust toolchain
|
2024-01-08 20:40:38 +00:00
|
|
|
uses: https://github.com/dtolnay/rust-toolchain@stable
|
2024-01-08 21:01:48 +00:00
|
|
|
- name: Build binaries
|
2024-01-08 20:40:38 +00:00
|
|
|
run: cargo build --release
|
2024-01-08 21:01:48 +00:00
|
|
|
- name: Read release content
|
|
|
|
id: read_release
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
r=$(cat .changes/v0.1.0.md) # <--- Read release.md (Provide correct path as per your repo)
|
|
|
|
r="${r//'%'/'%25'}" # Multiline escape sequences for %
|
|
|
|
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
|
|
|
|
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
|
|
|
|
echo "RELEASE_BODY=$r" >> $GITHUB_OUTPUT # <--- Set environment variable
|
2024-01-08 21:12:53 +00:00
|
|
|
- name: Use Go Action
|
|
|
|
id: use-go-action
|
|
|
|
uses: https://gitea.com/actions/release-action@main
|
2024-01-08 21:01:48 +00:00
|
|
|
with:
|
2024-01-08 21:12:53 +00:00
|
|
|
title: test
|
|
|
|
files: |-
|
|
|
|
target/release/cl-cli
|
|
|
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|
2024-01-08 21:01:48 +00:00
|
|
|
body: |
|
|
|
|
${{ steps.read_release.outputs.RELEASE_BODY }}
|