mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
ci: fixes tag uploads and container tagging
This commit is contained in:
@@ -6,11 +6,6 @@
|
|||||||
name: Build all targets
|
name: Build all targets
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
tag:
|
|
||||||
required: true
|
|
||||||
description: release version
|
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
@@ -51,26 +46,15 @@ jobs:
|
|||||||
- id: set-timestamp
|
- id: set-timestamp
|
||||||
run: echo "::set-output name=timestamp::$(date +"%Y%m%d%H%M%S")"
|
run: echo "::set-output name=timestamp::$(date +"%Y%m%d%H%M%S")"
|
||||||
|
|
||||||
# This job is also triggered with versioned tags
|
|
||||||
# Creating a and pushing a tag starting with "v" just as "v1.0.0"
|
|
||||||
# will trigger this workflow and when all builds are done create a Github Release
|
|
||||||
# then it will upload all binaries built as assets
|
|
||||||
# Additionally, we can also trigger this step manually
|
|
||||||
# From the Github Actions tab for this repository:
|
|
||||||
# https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml
|
|
||||||
# You can now click a "Run Workflow" button that will prompt you for a tag name
|
|
||||||
# This tag name has to match an existing tag otherwise the new release will be detached
|
|
||||||
# Note: Only developers with "write" permission to the repository can use this feature
|
|
||||||
- id: set-tag
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
|
|
||||||
run: echo "::set-output name=tagname::${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"
|
|
||||||
|
|
||||||
- id: set-branch
|
- id: set-branch
|
||||||
run: echo "::set-output name=branchname::${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
run: echo "::set-output name=branchname::${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
||||||
|
|
||||||
- name: Debug Matrix Output
|
- name: Debug Matrix Output
|
||||||
if: runner.debug == '1'
|
if: runner.debug == '1'
|
||||||
run: echo "$(./Tools/ci/generate_board_targets_json.py --group --verbose)"
|
run: |
|
||||||
|
echo "${{ steps.set-timestamp.outputs.timestamp }}"
|
||||||
|
echo "${{ steps.set-branch.outputs.branchname }}"
|
||||||
|
echo "$(./Tools/ci/generate_board_targets_json.py --group --verbose)"
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
name: Build Group [${{ matrix.group }}]
|
name: Build Group [${{ matrix.group }}]
|
||||||
@@ -159,20 +143,16 @@ jobs:
|
|||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}",spot=false]
|
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}",spot=false]
|
||||||
needs: [setup, group_targets]
|
needs: [setup, group_targets]
|
||||||
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
- name: Download Artifacts
|
- name: Download Artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
- name: Arrange Binaries
|
path: artifacts/
|
||||||
run: |
|
merge-multiple: true
|
||||||
mkdir artifacts
|
|
||||||
cp **/**/*.px4 artifacts/
|
|
||||||
|
|
||||||
- name: Upload Binaries to Release
|
- name: Upload Binaries to Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.group_targets.outputs.tagname }}
|
|
||||||
tag_name: ${{ needs.group_targets.outputs.tagname }}
|
|
||||||
draft: true
|
draft: true
|
||||||
files: artifacts/*.px4
|
files: artifacts/*.px4
|
||||||
|
|||||||
Reference in New Issue
Block a user