-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (107 loc) · 5.74 KB
/
build_package.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Build Ska Package
# This workflow builds a Ska package and optionally uploads it to a ska3-conda channel.
# It takes the following arguments:
#
# - package: the name of the package to build
# - tag: the tag to use for the package
# - arch: whether to build it for all architectures or as noarch (default is false)
# - upload: whether to upload the package to the ska3-conda channel (default is false)
# - python_version: the python version to use for the build (default is 3.11)
# - numpy_version: the numpy version to use for the build (default is 1.26.2)
# - channel_in: the channel to use for the build environment (default is flight).
# This channel gets passed to package_build workflow, which also adds conda-forge
# - channel_out: the channel to upload the package to (default is test)
# - skare3_branch: the branch of skare3 to use for the build (default is master)
#
# You call it like this:
# from skare3_tools import github
# repo = github.Repository("sot/skare3")
# repo.dispatch_event(
# "build-package",
# client_payload={
# "package": "sot/ska_helpers",
# "tag": '0.13.0',
# "arch": False,
# "upload": True
# }
# )
on:
repository_dispatch:
types:
- build-package
jobs:
# this job checks the arguments, sets defaults, and writes a summary
arguments:
runs-on: ubuntu-latest
steps:
- name: Parse Arguments
id: argument_parser
uses: skare3/check-arguments@main
with:
arguments: |
- name: package_name
default: ${{ github.event.client_payload.package_name }}
- name: tag
default: ${{ github.event.client_payload.tag }}
- name: noarch
type: boolean
default: ${{ github.event.client_payload.noarch }}
- name: python_version
default: ${{ github.event.client_payload.python_version }}
- name: numpy_version
default: ${{ github.event.client_payload.numpy_version }}
- name: miniconda_version
default: ${{ github.event.client_payload.miniconda_version }}
- name: skare3_branch
default: ${{ github.event.client_payload.skare3_branch }}
- name: channel
default: ${{ github.event.client_payload.channel }}
- name: platform
default: ${{ github.event.client_payload.platform }}
- shell: bash -l {0}
run: |
echo "ALL ARGS: ${{ toJson(steps.argument_parser.outputs.arguments) }}"
echo "package_name: ${{ fromJson(steps.argument_parser.outputs.arguments).package_name }}"
echo "tag: ${{ fromJson(steps.argument_parser.outputs.arguments).tag }}"
echo "noarch: ${{ fromJson(steps.argument_parser.outputs.arguments).noarch }}"
echo "python_version: ${{ fromJson(steps.argument_parser.outputs.arguments).python_version }}"
echo "numpy_version: ${{ fromJson(steps.argument_parser.outputs.arguments).numpy_version }}"
echo "miniconda_version: ${{ fromJson(steps.argument_parser.outputs.arguments).miniconda_version }}"
echo "skare3_branch: ${{ fromJson(steps.argument_parser.outputs.arguments).skare3_branch }}"
echo "channel: ${{ fromJson(steps.argument_parser.outputs.arguments).channel }}"
echo "platform: ${{ fromJson(steps.argument_parser.outputs.arguments).platform }}"
echo "## Arguments:" >> $GITHUB_STEP_SUMMARY
echo "package_name: ${{ fromJson(steps.argument_parser.outputs.arguments).package_name }}" >> $GITHUB_STEP_SUMMARY
echo "tag: ${{ fromJson(steps.argument_parser.outputs.arguments).tag }}" >> $GITHUB_STEP_SUMMARY
echo "noarch: ${{ fromJson(steps.argument_parser.outputs.arguments).noarch }}" >> $GITHUB_STEP_SUMMARY
echo "python_version: ${{ fromJson(steps.argument_parser.outputs.arguments).python_version }}" >> $GITHUB_STEP_SUMMARY
echo "numpy_version: ${{ fromJson(steps.argument_parser.outputs.arguments).numpy_version }}" >> $GITHUB_STEP_SUMMARY
echo "miniconda_version: ${{ fromJson(steps.argument_parser.outputs.arguments).miniconda_version }}" >> $GITHUB_STEP_SUMMARY
echo "skare3_branch: ${{ fromJson(steps.argument_parser.outputs.arguments).skare3_branch }}" >> $GITHUB_STEP_SUMMARY
echo "channel: ${{ fromJson(steps.argument_parser.outputs.arguments).channel }}" >> $GITHUB_STEP_SUMMARY
echo "platform: ${{ fromJson(steps.argument_parser.outputs.arguments).platform }}" >> $GITHUB_STEP_SUMMARY
# build:
# runs-on: ubuntu-latest
# needs: arguments # this job needs the arguments job because it uses the outputs
# steps:
# - name: Build
# uses: skare3/build@alpha
# with:
# package_name: ${{ github.event.client_payload.package }}
# tag: ${{ github.event.client_payload.tag }}
# noarch: ${{ !github.event.client_payload.arch && (github.event.client_payload.arch != 'true') && (github.event.client_payload.arch != 'True')}}
# #python_version: ${{ needs.arguments.outputs.python_version }}
# #numpy_version: ${{ needs.arguments.outputs.numpy_version }}
# #skare3_branch: ${{ needs.arguments.outputs.skare3_branch }}
# # the following channel in ska3-conda is used to create the build environment
# #channel: ${{ needs.arguments.outputs.channel_in }}
# CONDA_PASSWORD: ${{ secrets.CONDA_PASSWORD }}
# git_token: ${{ secrets.GITHUB_TOKEN }}
# platform: ubuntu-latest
# upload:
# if: ${{ github.event.client_payload.upload == 'true' }}
# needs: [build, arguments] # this job needs the arguments job because it uses the outputs
# uses: sot/upload
# with:
# # this is the destination ska3-conda channel
# channel: ${{ needs.arguments.outputs.channel_out }}