-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime manager for Tebako Ruby builds #176
Comments
To automate the upload of built runtimes to GitHub releases, you can extend your GitHub Actions workflow. Here's how you can modify the name: Build and Release Tebako Runtimes
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ruby-version: ['3.1.3', '3.2.4', '3.3.3']
include:
- os: ubuntu-latest
arch: x86_64
- os: macos-latest
arch: x86_64
- os: windows-latest
arch: x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Build Tebako Runtime
run: |
ruby -r ./lib/tebako/runtime_manager -e "
repo = Tebako::TebakoRuntimeRepository.new('runtimes')
builder = Tebako::TebakoRuntimeBuilder.new(repo)
builder.build_runtime('${{ matrix.ruby-version }}', '${{ runner.os }}', '${{ matrix.arch }}')
"
- name: Upload Runtime Artifact
uses: actions/upload-artifact@v2
with:
name: tebako-runtime-${{ matrix.ruby-version }}-${{ runner.os }}-${{ matrix.arch }}
path: runtimes/ruby-${{ matrix.ruby-version }}-${{ runner.os }}-${{ matrix.arch }}.tar.gz
- name: Upload Metadata Artifact
uses: actions/upload-artifact@v2
with:
name: tebako-runtime-metadata
path: runtimes/tebako_runtime_metadata.yml
release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: Prepare release assets
run: |
mkdir release_assets
cp -r tebako-runtime-*/* release_assets/
cp tebako-runtime-metadata/tebako_runtime_metadata.yml release_assets/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release_assets
asset_name: tebako-runtimes.zip
asset_content_type: application/zip This updated workflow does the following:
To use this workflow:
This setup automates the entire process of building, packaging, and releasing Tebako runtimes. Users can then download these runtimes directly from the GitHub releases page, or use the release URL in their Remember to update your |
We want to pre-compile the Ruby runtimes on GitHub Actions, in the tebako-runtimes repository.
We need the notion of a "Tebako runtime repository" which will compile Ruby runtimes of:
Each Ruby version needs to be patched to be useable by Tebako.
We need code to manage this, so we can compile Ruby runtimes into a local repository, and load Ruby runtimes from a remote repository.
When the local repository is uploaded to a GitHub repository, we can use it as a remote repository, allowing users to build/customize their own Ruby runtimes (with the necessary Tebako patches, of course).
Let's create a system for managing Tebako runtime repositories, both local and remote. We'll create a
TebakoRuntimeRepository
class that can handle local and remote repositories, and aTebakoRuntimeBuilder
class for compiling Ruby runtimes with Tebako patches.First, let's define the structure:
This implementation provides:
TebakoRuntimeRepository
: Manages a local repository of Ruby runtimes.TebakoRuntimeBuilder
: Builds Ruby runtimes with Tebako patches.TebakoRuntimeManager
: Manages both local and remote repositories, ensuring runtimes are available.To use this system:
To set up the GitHub Actions workflow for building runtimes in the
tebako-runtimes
repository, create a.github/workflows/build_runtimes.yml
file:This workflow will build Ruby runtimes for different versions, operating systems, and architectures. The built runtimes and metadata will be uploaded as artifacts.
To make these runtimes available as a remote repository, you can create a release in the
tebako-runtimes
repository and upload the artifacts to the release. Then, users can use the release URL as the remote repository URL when initializing theTebakoRuntimeManager
.This system allows for building custom Ruby runtimes with Tebako patches, managing them in local repositories, and distributing them via remote repositories (like GitHub releases). Users can either build their own runtimes or download pre-built ones from a remote repository.
The text was updated successfully, but these errors were encountered: