-
-
Notifications
You must be signed in to change notification settings - Fork 22
93 lines (91 loc) · 3.57 KB
/
pkg-binary.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
name: Package Binary
on:
workflow_call:
inputs:
arch:
default: x64
description: The architecture to build for eg x64 | arm64
required: true
type: string
edge:
default: false
description: Whether to build on the edge channel or not
required: false
type: boolean
filename:
default: lando
description: The name of the resulting binary
required: false
type: string
fatcore:
default: false
description: Whether to build a fat binary or not
required: false
type: boolean
node-version:
default: "20"
description: The node version to build for eg 16 | 18 | 20
required: true
type: string
os:
default: linux
description: The os to build for eg linux | macos | win
required: true
type: string
jobs:
pkg-binary:
runs-on: ${{ inputs.arch == 'arm64' && 'macos-14' || 'ubuntu-24.04' }}
env:
TERM: xterm
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install node ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: npm
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile --production
- name: Install fatcore
if: inputs.fatcore == true
run: scripts/fatcore-install.sh ${{ inputs.edge == true && '--edge' || '' }}
- name: Switch to edge channel
if: inputs.edge == true
run: |
sed -i.bak "s/^channel: stable/channel: edge/" config.yml
rm -rf config.yml.bak
- name: Prepare Release
uses: lando/prepare-release-action@v3
with:
version: dev
sync: false
- name: Package into binary
uses: lando/pkg-action@v6
with:
entrypoint: bin/lando
filename: ${{ inputs.filename }}
node-version: ${{ inputs.node-version }}
os: ${{ inputs.os }}
options: --options dns-result-order=ipv4first
pkg: "@yao-pkg/[email protected]"
upload-key: "lando-${{ inputs.os }}-${{ inputs.arch }}${{ inputs.fatcore == false && '-slim' || '' }}-${{ github.sha }}"
- name: Ensure version
if: (inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')
run: ./dist/${{ inputs.filename }} version --all
- name: Ensure ipv4first
if: (inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')
run: ./dist/${{ inputs.filename }} config --path cli.args | grep dns-result-order=ipv4first
- name: Ensure channel
if: (inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')
run: ./dist/${{ inputs.filename }} config --path channel | grep ${{ inputs.edge == true && 'edge' || 'stable' }}
- name: Ensure slimcore
if: ((inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')) && inputs.fatcore == false
run: ./dist/${{ inputs.filename }} config --path fatcore | grep false
- name: Ensure fatcore
if: ((inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')) && inputs.fatcore == true
run: |
./dist/${{ inputs.filename }} config --path fatcore | grep true
./dist/${{ inputs.filename }} config | grep -q "node_modules/@lando/wordpress"