Update README for ppa4 #174
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Ghostty | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
release_version: | |
description: The version to release. | |
type: string | |
required: true | |
permissions: | |
contents: write | |
concurrency: | |
# Repeated pushes to a PR will cancel all previous still running builds of the | |
# PR (for faster feedback), while multiple merges to main will not cancel. | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build-ghostty: | |
name: Build Ghostty | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- name: amd64 | |
runner: ubuntu-24.04 | |
- name: arm64 | |
runner: ubuntu-24.04-arm | |
builds: | |
- distro: "ubuntu" | |
version: "22.04" | |
- distro: "ubuntu" | |
version: "24.04" | |
- distro: "ubuntu" | |
version: "24.10" | |
- distro: "debian" | |
version: "bookworm" | |
runs-on: ${{ matrix.arch.runner }} | |
steps: | |
# See the docs: https://github.com/docker/build-push-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# This action checks out the source as part of the action and can therefore | |
# go before the checkout step. | |
- name: Build Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
tags: ghostty:${{ matrix.builds.distro }}-${{ matrix.builds.version }}-${{ matrix.arch.name }} | |
build-args: | | |
DISTRO=${{ matrix.builds.distro }} | |
DISTRO_VERSION=${{ matrix.builds.version }} | |
push: false | |
load: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Checkout ghostty-ubuntu | |
uses: actions/checkout@v4 | |
- name: Build Ghostty | |
run: docker run --rm -v$PWD:/workspace -w /workspace ghostty:${{ matrix.builds.distro }}-${{ matrix.builds.version }}-${{ matrix.arch.name }} /bin/bash build-ghostty.sh | |
- name: Lint .deb Package | |
# Lintian shouldn't fail our build yet | |
run: docker run --rm -v$PWD:/workspace -w /workspace ghostty:${{ matrix.builds.distro }}-${{ matrix.builds.version }}-${{ matrix.arch.name }} lintian ghostty_*.deb || true | |
- name: Test Installation | |
run: docker run --rm -v$PWD:/workspace -w /workspace ghostty:${{ matrix.builds.distro }}-${{ matrix.builds.version }}-${{ matrix.arch.name }} dpkg -i ghostty_*.deb | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package-${{ matrix.builds.distro }}-${{ matrix.builds.version }}-${{ matrix.arch.name }} | |
retention-days: 7 | |
path: ghostty_*.deb | |
release-ghostty: | |
name: (Pre-)Release Ghostty | |
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: build-ghostty | |
steps: | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: package-* | |
merge-multiple: true | |
- name: Validate Release Version | |
run: | | |
if ls *${{ inputs.release_version }}* 1> /dev/null 2>&1; then | |
# Version is correct. | |
# The git tag shouldn't have `~` | |
echo "RELEASE_TAG=$(echo '${{ inputs.release_version }}' | sed 's/~/-/g')" >> $GITHUB_ENV | |
else | |
echo "::error::Release version does not match filenames." | |
exit 1 | |
fi | |
- name: Publish Release Draft | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: ghostty_*.deb | |
name: ${{ inputs.release_version }} | |
tag_name: ${{ env.RELEASE_TAG }} | |
fail_on_unmatched_files: true |