Skip to content

Commit 51a4e35

Browse files
chore: migrate CI/release to ARC self-hosted runners (#93)
* chore: use ARC self-hosted runner for CI * chore: use ARC self-hosted runner for release workflow * fix: harden ARC runner migration with security and reliability safeguards - Fall back to `ubuntu-latest` for fork PRs to prevent untrusted code execution on self-hosted ARC runners - Add `timeout-minutes: 60` to all CI and release jobs (self-hosted runners have no default timeout unlike GitHub-hosted 6h limit) - Write `NPM_TOKEN` to `$RUNNER_TEMP/.npmrc` instead of `~/.npmrc` to prevent secret persistence on self-hosted runners - Set `NPM_CONFIG_USERCONFIG` to point publish step to temp `.npmrc` - Add `concurrency` group to CI workflow to cancel superseded runs --------- Co-authored-by: anandgupta42 <anand@altimate.ai>
1 parent 1a00dd9 commit 51a4e35

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on:
66
pull_request:
77
branches: [main]
88

9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
typescript:
1115
name: TypeScript
12-
runs-on: ubuntu-latest
16+
runs-on: ${{ github.event.pull_request.head.repo.fork && 'ubuntu-latest' || 'arc-runner-altimate-code' }}
17+
timeout-minutes: 60
1318
steps:
1419
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1520

@@ -39,7 +44,8 @@ jobs:
3944

4045
lint:
4146
name: Lint
42-
runs-on: ubuntu-latest
47+
runs-on: ${{ github.event.pull_request.head.repo.fork && 'ubuntu-latest' || 'arc-runner-altimate-code' }}
48+
timeout-minutes: 60
4349
steps:
4450
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
4551

@@ -56,7 +62,8 @@ jobs:
5662

5763
python:
5864
name: Python ${{ matrix.python-version }}
59-
runs-on: ubuntu-latest
65+
runs-on: ${{ github.event.pull_request.head.repo.fork && 'ubuntu-latest' || 'arc-runner-altimate-code' }}
66+
timeout-minutes: 60
6067
strategy:
6168
matrix:
6269
python-version: ["3.10", "3.11", "3.12"]

.github/workflows/release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ env:
1515
jobs:
1616
build:
1717
name: Build (${{ matrix.os }})
18-
runs-on: ubuntu-latest
18+
runs-on: arc-runner-altimate-code
19+
timeout-minutes: 60
1920
permissions:
2021
contents: read
2122
strategy:
@@ -58,7 +59,8 @@ jobs:
5859
publish-npm:
5960
name: Publish to npm
6061
needs: build
61-
runs-on: ubuntu-latest
62+
runs-on: arc-runner-altimate-code
63+
timeout-minutes: 60
6264
permissions:
6365
contents: read
6466
steps:
@@ -87,7 +89,7 @@ jobs:
8789
merge-multiple: true
8890

8991
- name: Configure npm auth
90-
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
92+
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > "$RUNNER_TEMP/.npmrc"
9193
env:
9294
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9395

@@ -115,14 +117,16 @@ jobs:
115117
OPENCODE_RELEASE: "1"
116118
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
117119
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
120+
NPM_CONFIG_USERCONFIG: ${{ runner.temp }}/.npmrc
118121
GH_REPO: ${{ env.GH_REPO }}
119122
GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
120123

121124
# Engine publish runs without waiting for build — it builds from source and
122125
# doesn't need CLI binary artifacts. This allows it to run in parallel.
123126
publish-engine:
124127
name: Publish engine to PyPI
125-
runs-on: ubuntu-latest
128+
runs-on: arc-runner-altimate-code
129+
timeout-minutes: 60
126130
environment: pypi
127131
permissions:
128132
contents: read
@@ -152,7 +156,8 @@ jobs:
152156
github-release:
153157
name: Create GitHub Release
154158
needs: [build, publish-npm]
155-
runs-on: ubuntu-latest
159+
runs-on: arc-runner-altimate-code
160+
timeout-minutes: 60
156161
permissions:
157162
contents: write
158163
steps:

0 commit comments

Comments
 (0)