forked from ubi-agni/ros-builder-action
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (83 loc) · 3.06 KB
/
interactive.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: interactive
on:
workflow_dispatch:
# The inputs should not define a default value.
# If they do, this value would be passed even if nothing is actually entered in the dialog,
# thus overriding any configuration variables set, which should be considered in this case.
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs
inputs:
DEB_DISTRO:
type: string
required: true
description: 'Ubuntu/Debian distro:'
default: jammy
ROS_DISTRO:
type: string
required: true
description: 'ROS distribution codename:'
default: one
ROS_SOURCES:
type: string
description: 'ROS sources to compile:'
required: true
default: '*.repos'
COLCON_PKG_SELECTION:
type: string
description: 'colcon package selection:'
required: false
SKIP_EXISTING:
type: boolean
description: Skip existing packages?
required: false
INSTALL_TO_CHROOT:
type: boolean
description: Incrementally fill chroot?
required: false
DEPLOY_MODE:
type: choice
description: How to deploy?
required: true
default: skip
options:
- skip
- squash
- append
BRANCH:
type: string
description: 'Branch to use:'
required: false
env:
BRANCH: ${{ inputs.BRANCH || format('{0}-{1}', inputs.DEB_DISTRO, inputs.ROS_DISTRO) }}
jobs:
build:
name: ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO || 'latest' }}-${{ inputs.ROS_DISTRO || vars.ROS_DISTRO || 'one'}}
uses: ubi-agni/ros-builder-action/.github/workflows/generic.yaml@main
with:
DEB_DISTRO: ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO }}
ROS_DISTRO: ${{ inputs.ROS_DISTRO || vars.ROS_DISTRO || 'one' }}
ROS_SOURCES: ${{ inputs.ROS_SOURCES || vars.ROS_SOURCES }}
COLCON_PKG_SELECTION: ${{ inputs.COLCON_PKG_SELECTION || vars.COLCON_PKG_SELECTION || '' }}
# proceed from existing debs artifact if run_attempt > 1
DOWNLOAD_DEBS: ${{ github.run_attempt != '1' }}
SKIP_EXISTING: ${{ inputs.SKIP_EXISTING || vars.SKIP_EXISTING || false}}
INSTALL_TO_CHROOT: ${{ inputs.INSTALL_TO_CHROOT || vars.INSTALL_TO_CHROOT || false }}
deploy:
needs: build
runs-on: ubuntu-latest
if: ( inputs.DEPLOY_MODE != 'skip' ) && vars.DEPLOY_URL
env: # define common environment variables (cannot be passed from calling workflow)
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 10
FOLDER: ${{ vars.DEBS_PATH || '~/debs' }}
REPO: ${{ vars.DEPLOY_URL }}
steps:
- name: Download debs from build
uses: actions/download-artifact@v3
with:
name: debs
path: ${{ env.FOLDER }}
- name: Deploy
uses: s0/git-publish-subdir-action@v2.6.0
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_PRIVATE_KEY }}
MESSAGE: "${{ inputs.DEB_DISTRO }}-${{ inputs.ROS_DISTRO }} build"
SQUASH_HISTORY: ${{ inputs.DEPLOY_MODE == 'squash' }}