Skip to content

Commit 92aa9bd

Browse files
committed
Fix commit artifact workflow
- Actions update to comply with Node warning deprecation - Typo file rename on build.yml to build.yaml - Commit artifacts separated to a owned workflow
1 parent 67dfe3d commit 92aa9bd

2 files changed

Lines changed: 102 additions & 86 deletions

File tree

.github/workflows/build.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build Binaries
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
tags: ['v*']
7+
pull_request:
8+
branches: ['main']
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
include:
20+
- os: ubuntu-24.04
21+
name: linux
22+
arch: amd64
23+
- os: ubuntu-24.04-arm
24+
name: linux
25+
arch: arm64
26+
- os: windows-latest
27+
name: windows
28+
arch: amd64
29+
- os: macos-latest
30+
name: macos
31+
arch: arm64
32+
- os: macos-15-intel
33+
name: macos
34+
arch: amd64
35+
36+
steps:
37+
- uses: actions/checkout@v6
38+
39+
- name: Build binary (Linux in Ubuntu 25.10 container)
40+
if: matrix.name == 'linux'
41+
shell: bash
42+
run: |
43+
# Docker container with Ubuntu 25.10 and build the binary inside it
44+
rm -rf dist/*
45+
docker run --rm \
46+
-v "$PWD:/workspace" \
47+
-w /workspace \
48+
ubuntu:25.10 \
49+
bash -c "
50+
set -e
51+
echo 'Setting up Ubuntu 25.10 build environment...'
52+
53+
apt-get update -y
54+
apt-get install -y --fix-missing curl python3 python3-pip python3-venv binutils
55+
56+
# Install uv (Python package manager)
57+
curl -LsSf https://astral.sh/uv/install.sh | sh
58+
export PATH=\"\$HOME/.local/bin:\$PATH\"
59+
60+
echo 'Building binary with uv...'
61+
uv sync
62+
uv run build.py
63+
64+
echo 'Build completed. Checking output:'
65+
ls -la dist/
66+
"
67+
68+
- name: Setup uv for Windows/macOS
69+
if: matrix.name != 'linux'
70+
uses: astral-sh/setup-uv@v7
71+
72+
- name: Build binary (Windows/macOS native)
73+
if: matrix.name != 'linux'
74+
shell: bash
75+
run: |
76+
rm -rf dist/*
77+
uv sync
78+
uv run build.py
79+
80+
- name: Upload artifacts
81+
uses: actions/upload-artifact@v6
82+
with:
83+
name: perfecto-mcp-${{ matrix.name }}-${{ matrix.arch }}
84+
path: dist/
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,33 @@
1-
name: Build Binaries
1+
name: Commit Dist Artifacts
2+
3+
# Publishes binaries built by "Build Binaries" back into dist/ on main.
24

35
on:
4-
push:
5-
branches: ['main']
6-
tags: ['v*']
7-
pull_request:
6+
workflow_run:
7+
workflows: ["Build Binaries"]
8+
types: [completed]
89
branches: ['main']
9-
workflow_dispatch:
1010

1111
permissions:
1212
contents: write
13+
actions: read
1314

1415
jobs:
15-
build:
16-
runs-on: ${{ matrix.os }}
17-
strategy:
18-
matrix:
19-
include:
20-
- os: ubuntu-24.04
21-
name: linux
22-
arch: amd64
23-
- os: ubuntu-24.04-arm
24-
name: linux
25-
arch: arm64
26-
- os: windows-latest
27-
name: windows
28-
arch: amd64
29-
- os: macos-latest
30-
name: macos
31-
arch: arm64
32-
- os: macos-15-intel
33-
name: macos
34-
arch: amd64
35-
36-
steps:
37-
- uses: actions/checkout@v4
38-
39-
- name: Build binary (Linux in Ubuntu 25.10 container)
40-
if: matrix.name == 'linux'
41-
shell: bash
42-
run: |
43-
# Docker container with Ubuntu 25.10 and build the binary inside it
44-
rm -rf dist/*
45-
docker run --rm \
46-
-v "$PWD:/workspace" \
47-
-w /workspace \
48-
ubuntu:25.10 \
49-
bash -c "
50-
set -e
51-
echo 'Setting up Ubuntu 25.10 build environment...'
52-
53-
apt-get update -y
54-
apt-get install -y --fix-missing curl python3 python3-pip python3-venv binutils
55-
56-
# Install uv (Python package manager)
57-
curl -LsSf https://astral.sh/uv/install.sh | sh
58-
export PATH=\"\$HOME/.local/bin:\$PATH\"
59-
60-
echo 'Building binary with uv...'
61-
uv sync
62-
uv run build.py
63-
64-
echo 'Build completed. Checking output:'
65-
ls -la dist/
66-
"
67-
68-
- name: Setup uv for Windows/macOS
69-
if: matrix.name != 'linux'
70-
uses: astral-sh/setup-uv@v4
71-
72-
- name: Build binary (Windows/macOS native)
73-
if: matrix.name != 'linux'
74-
shell: bash
75-
run: |
76-
rm -rf dist/*
77-
uv sync
78-
uv run build.py
79-
80-
- name: Upload artifacts
81-
uses: actions/upload-artifact@v4
82-
with:
83-
name: perfecto-mcp-${{ matrix.name }}-${{ matrix.arch }}
84-
path: dist/
85-
8616
commit-artifacts:
87-
needs: build
8817
runs-on: ubuntu-latest
89-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
18+
if: github.event.workflow_run.conclusion == 'success'
9019
steps:
91-
- uses: actions/checkout@v4
92-
93-
- name: Download all artifacts
94-
uses: actions/download-artifact@v4
20+
- uses: actions/checkout@v6
21+
with:
22+
token: ${{ secrets.REPO_PUSH_PAT || secrets.GITHUB_TOKEN }}
23+
24+
- name: Download all artifacts from triggering Build Binaries run
25+
uses: actions/download-artifact@v7
9526
with:
9627
path: artifacts/
97-
28+
run-id: ${{ github.event.workflow_run.id }}
29+
github-token: ${{ secrets.GITHUB_TOKEN }}
30+
9831
- name: Organize artifacts into dist/
9932
shell: bash
10033
run: |
@@ -138,7 +71,7 @@ jobs:
13871
13972
echo "Final dist/ contents:"
14073
ls -la dist/ || echo "No dist/ directory found"
141-
74+
14275
- name: Commit all artifacts to repository
14376
shell: bash
14477
run: |
@@ -151,4 +84,3 @@ jobs:
15184
git commit -m "[skip ci] Update all binary artifacts"
15285
git push
15386
fi
154-

0 commit comments

Comments
 (0)