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: push:
tags: ['v*'] tags: ['v*']
workflow_dispatch: workflow_dispatch:
inputs:
platforms:
description: 'Which builds to run: all, or a comma list of macos, windows, linux'
default: all
permissions: permissions:
contents: write contents: write
jobs: jobs:
macos: macos:
runs-on: macos-14 if: github.event_name == 'push' || inputs.platforms == 'all' || contains(inputs.platforms, 'macos')
runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- uses: actions/setup-node@v4 - uses: actions/setup-node@v5
with: with:
node-version: 22 node-version: 22
cache: npm cache: npm
@@ -42,7 +47,7 @@ jobs:
lipo -archs dist-cli/knock | grep -q x86_64 lipo -archs dist-cli/knock | grep -q x86_64
ls target/universal-apple-darwin/release/bundle/dmg/*.dmg ls target/universal-apple-darwin/release/bundle/dmg/*.dmg
./dist-cli/knock --version ./dist-cli/knock --version
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v5
with: with:
name: macos name: macos
path: | path: |
@@ -51,11 +56,12 @@ jobs:
# Best effort per the spec. # Best effort per the spec.
windows: windows:
if: github.event_name == 'push' || inputs.platforms == 'all' || contains(inputs.platforms, 'windows')
runs-on: windows-latest runs-on: windows-latest
continue-on-error: true continue-on-error: true
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- uses: actions/setup-node@v4 - uses: actions/setup-node@v5
with: with:
node-version: 22 node-version: 22
cache: npm cache: npm
@@ -68,7 +74,7 @@ jobs:
run: | run: |
cargo build --release --locked -p knock-cli cargo build --release --locked -p knock-cli
Compress-Archive -Path target/release/knock.exe -DestinationPath knock-cli-windows-x64.zip Compress-Archive -Path target/release/knock.exe -DestinationPath knock-cli-windows-x64.zip
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v5
with: with:
name: windows name: windows
path: | path: |
@@ -79,10 +85,11 @@ jobs:
# Native amd64 Linux build on Ubuntu 22.04, with the AppImage the arm64 # Native amd64 Linux build on Ubuntu 22.04, with the AppImage the arm64
# Gitea runner cannot make, and a real smoke test. # Gitea runner cannot make, and a real smoke test.
linux: linux:
if: github.event_name == 'push' || inputs.platforms == 'all' || contains(inputs.platforms, 'linux')
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- uses: actions/setup-node@v4 - uses: actions/setup-node@v5
with: with:
node-version: 22 node-version: 22
cache: npm 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 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 knock run /tmp/c
timeout 10 xvfb-run -a knock-app || [ $? -eq 124 ] timeout 10 xvfb-run -a knock-app || [ $? -eq 124 ]
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v5
with: with:
name: linux name: linux
path: | path: |
@@ -119,7 +126,7 @@ jobs:
needs: [macos, linux, windows] needs: [macos, linux, windows]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v5
with: with:
path: artifacts path: artifacts
- name: Attach to the GitHub release - name: Attach to the GitHub release