Skip to content

Runner CD

Runner CD #1

Workflow file for this run

name: Runner CD
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # Every Sunday at midnight UTC
permissions:
contents: write
jobs:
merge-upstream:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Merge upstream
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote add upstream https://github.com/actions/runner
git fetch upstream
git merge --no-edit upstream/main
git push origin main
check:
needs: merge-upstream
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check_version.outputs.should_release }}
version: ${{ steps.check_version.outputs.version }}
steps:
- uses: actions/checkout@v5
with:
ref: main
- name: Check version
id: check_version
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get latest upstream runner version
VERSION=$(gh release view --repo actions/runner --json tagName --jq '.tagName' | sed 's/^v//')
echo "Latest runner version: ${VERSION}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
# Check if we already have this release
if gh release view "v${VERSION}" --repo "${{ github.repository }}" >/dev/null 2>&1; then
echo "Release v${VERSION} already exists, skipping"
echo "should_release=false" >> "$GITHUB_OUTPUT"
else
echo "No existing release found, will build"
echo "should_release=true" >> "$GITHUB_OUTPUT"
fi
build:
needs: check
if: needs.check.outputs.should_release == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Update runnerversion file
run: echo "${{ needs.check.outputs.version }}" > src/runnerversion
- name: Build & Layout Release
run: ./dev.sh layout Release linux-x64
working-directory: src
- name: Package Release
run: ./dev.sh package Release linux-x64
working-directory: src
- name: Create release and upload asset
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${{ needs.check.outputs.version }}"
ASSET="_package/actions-runner-linux-x64-${VERSION}.tar.gz"
sha256sum "${ASSET}"
gh release create "v${VERSION}" "${ASSET}" \
--repo "${{ github.repository }}" \
--title "v${VERSION}" \
--notes "See [upstream release notes](https://github.com/actions/runner/releases/tag/v${VERSION}). This build includes the [CUSTOM_ACTIONS_RESULTS_URL patch](https://github.com/falcondev-oss/github-actions-runner) for self-hosted cache server support."