AimRT/.github/workflows/release-workflow.yml

91 lines
2.9 KiB
YAML
Raw Normal View History

name: deploy Workflow
on:
workflow_call:
inputs:
image_name:
required: true
type: string
default: ubuntu
image_tag:
required: false
type: string
default: latest
run_platform:
required: false
type: string
default: amd64
secrets:
TEST_CMD:
required: true
jobs:
release:
runs-on: ${{ inputs.run_platform }}
container:
image: ${{ inputs.image_name }}:${{ inputs.image_tag }}
steps:
- name: download build artifact
uses: actions/download-artifact@v3
env:
https_proxy: ${{ secrets.https_proxy }}
http_proxy: ${{ secrets.http_proxy }}
with:
name: build_artifact
path: |
${{vars.WHL_ARTIFACTS_DIR}}
- name: Get short sha
id: slug
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
- name: Set up release information
id: release_info
shell: bash
run: |
VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
echo "RELEASE_NAME=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "RELEASE_DIR=${{ github.repository }}/${{ github.ref_name }}/${{ github.sha }}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Upload wheel packages
shell: bash
id: whl_upload
run: |
set -x
ls -lah ${{ vars.WHL_ARTIFACTS_DIR }}
echo ${{ vars.WHL_ARTIFACTS_DIR }}
echo "${{ secrets.ARTIFACTS_URL }}/${{ steps.release_info.outputs.VERSION }}"
find "${{ vars.WHL_ARTIFACTS_DIR }}" -name "*.whl" -exec curl -F "file=@{}" "${{ secrets.ARTIFACTS_WHL_URL }}/${{ steps.release_info.outputs.VERSION }}" \;
echo "上传 whl 包成功"
- name: 上传Release 产物
uses: softprops/action-gh-release@v1
env:
https_proxy: ${{ secrets.https_proxy }}
http_proxy: ${{ secrets.http_proxy }}
GITHUB_TOKEN: ${{ secrets.PATOKEN }}
with:
name: ${{ github.ref_name }}
files: |
${{ vars.WHL_ARTIFACTS_DIR }}/*.whl
- name: 显示 report 文件
shell: bash
run: |
if [ -n "${{secrets.CPPCHECK_REPORT_POST_URL}}" ]; then
check_report_dir=${{ github.repository }}/${{ github.ref_name }}/${{ steps.slug.outputs.sha8 }}
echo "cppcheck report url: ${{secrets.CPPCHECK_REPORT_URL}}/$check_report_dir/index.html"
fi
if [ -n "${{secrets.TEST_COVERAGE_REPORT_POST_URL}}" ]; then
test_coverage_dir=${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.ref_name }}/${{ steps.slug.outputs.sha8 }}
echo "test coverage report url: ${{secrets.TEST_COVERAGE_REPORT_URL}}/$test_coverage_dir/index.html"
fi