Skip to content

Commit

Permalink
add pkg-binary edging and start to rework dev-release
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Nov 15, 2024
1 parent 2355f26 commit 6fac3bd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 71 deletions.
75 changes: 13 additions & 62 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,26 @@ on:

jobs:
package:
runs-on: ${{ matrix.runner }}
env:
TERM: xterm
uses: ./.github/workflows/pkg-binary.yml
strategy:
fail-fast: false
matrix:
node-version:
- '20'
arch:
- x64
- arm64
os:
- linux
- macos
- win
runner:
- macos-14
- ubuntu-24.04
type:
- '-slim'
- ''

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile --production
- name: Install fatcore
if: matrix.type == ''
run: scripts/fatcore-install.sh --edge
- name: Switch to edge channel
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 node binary
uses: lando/pkg-action@v5
with:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
pkg: "@yao-pkg/[email protected]"
upload-key: "lando-${{ matrix.os }}-${{ matrix.runner == 'macos-14' && 'arm64' || 'x64' }}${{ matrix.type }}-${{ github.sha }}"
- name: Ensure version
if: (matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')
run: ./dist/@lando/core version --all
- name: Ensure ipv4first
if: (matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')
run: ./dist/@lando/core config --path cli.args | grep dns-result-order=ipv4first
- name: Ensure edge channel
if: (matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')
run: ./dist/@lando/core config --path channel | grep edge
- name: Ensure slimcore
if: ((matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')) && matrix.type == '-slim'
run: ./dist/@lando/core config --path fatcore | grep false
- name: Ensure fatcore
if: ((matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')) && matrix.type == ''
run: |
./dist/@lando/core config --path fatcore | grep true
./dist/@lando/core config | grep -q "node_modules/@lando/wordpress"
fatcore:
- false
- edge
with:
arch: ${{ matrix.arch }}
fatcore: ${{ matrix.fatcore }}
filename: lando-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.fatcore == 'false' && '-slim' || '' }}-${{ github.sha }}
node-version: "20"
os: ${{ matrix.os }}

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/pkg-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ on:
required: false
type: string
fatcore:
default: false
default: 'false'
description: Whether to build a fat binary or not
required: false
type: boolean
type: string

jobs:
pkg-binary:
Expand All @@ -47,8 +47,13 @@ jobs:
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile --production
- name: Install fatcore
if: inputs.fatcore == true
run: scripts/fatcore-install.sh
if: inputs.fatcore == 'true' || inputs.fatcore == 'edge'
run: scripts/fatcore-install.sh ${{ inputs.fatcore == 'edge' && '--edge' || '' }}
- name: Switch to edge channel
if: inputs.fatcore == 'edge'
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:
Expand All @@ -63,21 +68,21 @@ jobs:
os: ${{ inputs.os }}
options: --options dns-result-order=ipv4first
pkg: "@yao-pkg/[email protected]"
upload-key: "lando-${{ inputs.os }}-${{ inputs.arch }}${{ inputs.fatcore == true && '' || '-slim' }}-${{ github.sha }}"
upload-key: "lando-${{ inputs.os }}-${{ inputs.arch }}${{ inputs.fatcore == 'true' && '' || '-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 stable channel
- name: Ensure channel
if: (inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')
run: ./dist/${{ inputs.filename }} config --path channel | grep stable
run: ./dist/${{ inputs.filename }} config --path channel | grep ${{ inputs.fatcore == 'edge' && 'edge' || 'stable' }}
- name: Ensure slimcore
if: ((inputs.os == 'linux' && runner.os == 'Linux') || (inputs.os == 'macos' && runner.os == 'macOS')) && inputs.fatcore == false
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
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"

0 comments on commit 6fac3bd

Please sign in to comment.