GitHub workflow: macos-latest, Node 24 actions, choose platforms for manual runs

This commit is contained in:
2026-11-27 18:58:17 +01:00
parent 5ad72214a8
commit d96f9939a0
+18 -11
View File
@@ -7,16 +7,21 @@ on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
platforms:
description: 'Which builds to run: all, or a comma list of macos, windows, linux'
default: all
permissions:
contents: write
jobs:
macos:
runs-on: macos-14
if: github.event_name == 'push' || inputs.platforms == 'all' || contains(inputs.platforms, 'macos')
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
@@ -42,7 +47,7 @@ jobs:
lipo -archs dist-cli/knock | grep -q x86_64
ls target/universal-apple-darwin/release/bundle/dmg/*.dmg
./dist-cli/knock --version
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: macos
path: |
@@ -51,11 +56,12 @@ jobs:
# Best effort per the spec.
windows:
if: github.event_name == 'push' || inputs.platforms == 'all' || contains(inputs.platforms, 'windows')
runs-on: windows-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
@@ -68,7 +74,7 @@ jobs:
run: |
cargo build --release --locked -p knock-cli
Compress-Archive -Path target/release/knock.exe -DestinationPath knock-cli-windows-x64.zip
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: windows
path: |
@@ -79,10 +85,11 @@ jobs:
# Native amd64 Linux build on Ubuntu 22.04, with the AppImage the arm64
# Gitea runner cannot make, and a real smoke test.
linux:
if: github.event_name == 'push' || inputs.platforms == 'all' || contains(inputs.platforms, 'linux')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
@@ -106,7 +113,7 @@ jobs:
printf 'name: Root\nurl: http://127.0.0.1:18765/\nassert:\n - { on: status, equals: 200 }\n' > /tmp/c/root.yaml
knock run /tmp/c
timeout 10 xvfb-run -a knock-app || [ $? -eq 124 ]
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: linux
path: |
@@ -119,7 +126,7 @@ jobs:
needs: [macos, linux, windows]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v5
with:
path: artifacts
- name: Attach to the GitHub release