Skip to content

Commit

Permalink
improve lando shellenv to produce more consistent newliney output (#255)
Browse files Browse the repository at this point in the history
* improve lando shellenv to produce more consistent newliney output

* rework FATCORE edging to accomodate deprecated plugins

* consolidate devops further for checksumming

* consolidate devops further for checksumming part 2

* consolidate devops further for checksumming part 3

* consolidate devops further for checksumming part 4

* PEMDAS

* PEMDAS2

* checksum debugging

* checksum debugging part 2

* checksum debugging part 3

* checksum debugging part 4

* checksum debugging part 5

* checksum debugging part 6

* checksum debugging part 7

* checksum debugging part 8
  • Loading branch information
pirog authored Oct 26, 2024
1 parent a93704a commit d36fff0
Show file tree
Hide file tree
Showing 14 changed files with 305 additions and 152 deletions.
53 changes: 36 additions & 17 deletions .github/workflows/dev-release-cli.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Dev CLI Releases
name: Create Dev Releases

on:
push:
Expand All @@ -14,15 +14,17 @@ jobs:
strategy:
fail-fast: false
matrix:
runner:
- macos-14
- ubuntu-24.04
node-version:
- '20'
os:
- linux
- macos
- win
runner:
- macos-14
- ubuntu-24.04
type:
- '-slim'

steps:
- name: Checkout code
Expand All @@ -37,16 +39,17 @@ jobs:
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile --production
- name: Install fatcore
run: scripts/fatcore-install.sh
if: matrix.type != '-slim'
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: Ensure version
run: node ./bin/lando version
- name: Ensure plugins installed
run: node ./bin/lando config | grep -q "node_modules/@lando/wordpress"
- name: Package into node binary
uses: lando/pkg-action@v5
with:
Expand All @@ -55,15 +58,23 @@ jobs:
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
pkg: "@yao-pkg/[email protected]"
- name: Ensure fatcore
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/core config --path fatcore | grep true
- 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' && runner.arch == 'X64'
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' && runner.arch == 'X64'
# run: ./dist/@lando/core config --path channel | grep edge
- 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 != '-slim'
run:
./dist/@lando/core config --path fatcore | grep true
./dist/@lando/core config | grep -q "node_modules/@lando/wordpress"

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -148,12 +159,20 @@ jobs:
- name: Rename as needed
shell: bash
run: |
# create aliases
mkdir -p releases
cp ${{ steps.code-sign-action.outputs.file }} releases/${{ matrix.result }}
cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/latest/;')"
cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/dev/;')"
chmod +x releases/*
ls -lsa releases
# create checksums
./scripts/generate-checksums.sh --directory releases --output checksums-dev.txt --depth 2
# cat the data
cat checksums-dev.txt
# move the checksums so it is uploaded as well
cp checksums-dev.txt releases/checksums-dev.txt
- name: Configure S3 Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/dev-release-slim-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ jobs:
- name: Ensure ipv4first
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/core config --path cli.args | grep dns-result-order=ipv4first
# - name: Ensure edge channel
# if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
# run: ./dist/@lando/core config --path channel | grep edge
- name: Ensure edge channel
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/core config --path channel | grep edge

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -148,12 +148,19 @@ jobs:
- name: Rename as needed
shell: bash
run: |
# create releases
mkdir -p releases
cp ${{ steps.code-sign-action.outputs.file }} releases/${{ matrix.result }}
cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/latest/;')"
cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/dev/;')"
chmod +x releases/*
ls -lsa releases
# create checksums
./scripts/generate-checksums.sh --directory releases --output checksums-dev-slim.txt
# cat the data
cat checksums-dev-slim.txt
# move the checksums so it is uploaded as well
cp checksums-dev-slim.txt releases/checksums-dev-slim.txt
- name: Configure S3 Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
Expand Down
63 changes: 0 additions & 63 deletions .github/workflows/pr-release-cli-tests.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/pr-release-slim-cli-tests-slim.yml

This file was deleted.

116 changes: 116 additions & 0 deletions .github/workflows/pr-release-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: PR Release Tests

on:
pull_request:

jobs:
package:
runs-on: ${{ matrix.runner }}
env:
TERM: xterm
strategy:
fail-fast: false
matrix:
runner:
- macos-14
- ubuntu-24.04
node-version:
- '20'
os:
- linux
- macos
- win
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 != '-slim'
run: scripts/fatcore-install.sh
- 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 stable channel
if: (matrix.os == 'linux' && runner.os == 'Linux') || (matrix.os == 'macos' && runner.os == 'macOS')
run: ./dist/@lando/core config --path channel | grep stable
- 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"
release:
runs-on: ${{ matrix.os }}
needs:
- package
env:
TERM: xterm
strategy:
matrix:
os:
- ubuntu-24.04
node-version:
- '20'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: dist
- name: Verify artifacts
run: |
./scripts/generate-checksums.sh --directory dist --depth 2 --show
cat checksums.txt | grep "$(sha256sum dist/lando-linux-x64-slim-${{ github.sha }}/core)"
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: npm
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile
- name: Lint code
run: npm run lint
- name: Run unit tests
run: npm run test:unit
- name: Prepare Release
uses: lando/prepare-release-action@v3
with:
version: dev
sync: false
lando-plugin: true
- name: Publish to npm dryrun
run: npm publish --access public --dry-run
6 changes: 3 additions & 3 deletions .github/workflows/release-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ jobs:
- name: Ensure ipv4first
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/core config --path cli.args | grep dns-result-order=ipv4first
# - name: Ensure edge channel
# if: github.event.release.prerelease == true && matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
# run: ./dist/@lando/core config --path channel | grep edge
- name: Ensure edge channel
if: github.event.release.prerelease == true && matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/core config --path channel | grep edge

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down
Loading

0 comments on commit d36fff0

Please sign in to comment.