From 9d2a85d9cd62918b973a9275158030282217b3a9 Mon Sep 17 00:00:00 2001 From: Patrick Fong Date: Thu, 28 Sep 2023 10:42:38 -0700 Subject: [PATCH] lint all Yaml files --- .github/workflows/clean-artifacts.yml | 14 +- .github/workflows/release-tip.yml | 232 +++++++++++++------------- .github/workflows/test.yml | 113 +++++++------ com.mitchellh.ghostty.yml | 2 +- vendor/pixman/.gitlab-ci.yml | 28 ++-- 5 files changed, 194 insertions(+), 195 deletions(-) diff --git a/.github/workflows/clean-artifacts.yml b/.github/workflows/clean-artifacts.yml index 5f0d3d782..5337c264a 100644 --- a/.github/workflows/clean-artifacts.yml +++ b/.github/workflows/clean-artifacts.yml @@ -2,16 +2,16 @@ name: Clean Artifacts on: schedule: # Once a day - - cron: '0 0 * * *' + - cron: "0 0 * * *" workflow_dispatch: jobs: remove-old-artifacts: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: Remove old artifacts - uses: c-hive/gha-remove-artifacts@v1 - with: - age: '1 week' - skip-tags: true - skip-recent: 5 + - name: Remove old artifacts + uses: c-hive/gha-remove-artifacts@v1 + with: + age: "1 week" + skip-tags: true + skip-recent: 5 diff --git a/.github/workflows/release-tip.yml b/.github/workflows/release-tip.yml index 2a1eea4b0..65229f1bc 100644 --- a/.github/workflows/release-tip.yml +++ b/.github/workflows/release-tip.yml @@ -13,13 +13,13 @@ jobs: runs-on: ubuntu-latest needs: [build-macos] steps: - - uses: actions/checkout@v4 - - name: Tip Tag - run: | - git config user.name "GitHub Actions Bot" - git config user.email "<>" - git tag -fa tip -m "Latest Continuous Release" ${GITHUB_SHA} - git push --force origin tip + - uses: actions/checkout@v4 + - name: Tip Tag + run: | + git config user.name "GitHub Actions Bot" + git config user.email "<>" + git tag -fa tip -m "Latest Continuous Release" ${GITHUB_SHA} + git push --force origin tip build-macos: if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} @@ -29,130 +29,130 @@ jobs: # Needed for macos SDK AGREE: "true" steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 - # Install Nix and use that to run our tests so our environment matches exactly. - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-unstable + # Install Nix and use that to run our tests so our environment matches exactly. + - uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable - # Setup our S3 client - - name: Setup s3cmd - uses: s3-actions/s3cmd@v1.5.0 - with: - provider: cloudflare - account_id: ${{ secrets.CF_R2_TIP_ACCOUNT_ID }} - access_key: ${{ secrets.CF_R2_TIP_AWS_KEY }} - secreT_key: ${{ secrets.CF_R2_TIP_SECRET_KEY }} + # Setup our S3 client + - name: Setup s3cmd + uses: s3-actions/s3cmd@v1.5.0 + with: + provider: cloudflare + account_id: ${{ secrets.CF_R2_TIP_ACCOUNT_ID }} + access_key: ${{ secrets.CF_R2_TIP_AWS_KEY }} + secreT_key: ${{ secrets.CF_R2_TIP_SECRET_KEY }} - # Load Build Number - - name: Build Number - run: | - echo "GHOSTTY_BUILD=$(git rev-list --count head)" >> $GITHUB_ENV + # Load Build Number + - name: Build Number + run: | + echo "GHOSTTY_BUILD=$(git rev-list --count head)" >> $GITHUB_ENV - # GhosttyKit is the framework that is built from Zig for our native - # Mac app to access. Build this in release mode. - - name: Build GhosttyKit - run: nix develop -c zig build -Dstatic=true -Doptimize=ReleaseFast + # GhosttyKit is the framework that is built from Zig for our native + # Mac app to access. Build this in release mode. + - name: Build GhosttyKit + run: nix develop -c zig build -Dstatic=true -Doptimize=ReleaseFast - # The native app is built with native XCode tooling. This also does - # codesigning. IMPORTANT: this must NOT run in a Nix environment. - # Nix breaks xcodebuild so this has to be run outside. - - name: Build Ghostty.app - run: cd macos && xcodebuild -configuration Release + # The native app is built with native XCode tooling. This also does + # codesigning. IMPORTANT: this must NOT run in a Nix environment. + # Nix breaks xcodebuild so this has to be run outside. + - name: Build Ghostty.app + run: cd macos && xcodebuild -configuration Release - # We inject the "build number" as simply the number of commits since HEAD. - # This will be a monotonically always increasing build number that we use. - - name: Inject Build Number - run: | - echo "Setting build to $GHOSTTY_BUILD" - /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $GHOSTTY_BUILD" "macos/build/Release/Ghostty.app/Contents/Info.plist" + # We inject the "build number" as simply the number of commits since HEAD. + # This will be a monotonically always increasing build number that we use. + - name: Inject Build Number + run: | + echo "Setting build to $GHOSTTY_BUILD" + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $GHOSTTY_BUILD" "macos/build/Release/Ghostty.app/Contents/Info.plist" - - name: Zip Unsigned App - run: nix develop -c sh -c 'cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal-unsigned.zip Ghostty.app' + - name: Zip Unsigned App + run: nix develop -c sh -c 'cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal-unsigned.zip Ghostty.app' - # Update Release - - name: Release Unsigned - uses: softprops/action-gh-release@v1 - with: - name: "Ghostty Tip (\"Nightly\")" - prerelease: true - tag_name: tip - target_commitish: ${{ github.sha }} - files: ghostty-macos-universal-unsigned.zip - token: ${{ secrets.GH_RELEASE_TOKEN }} + # Update Release + - name: Release Unsigned + uses: softprops/action-gh-release@v1 + with: + name: 'Ghostty Tip ("Nightly")' + prerelease: true + tag_name: tip + target_commitish: ${{ github.sha }} + files: ghostty-macos-universal-unsigned.zip + token: ${{ secrets.GH_RELEASE_TOKEN }} - - name: Codesign app bundle - env: - MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }} - MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }} - MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }} - MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }} - run: | - # Turn our base64-encoded certificate back to a regular .p12 file - echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 + - name: Codesign app bundle + env: + MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }} + MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }} + MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }} + MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }} + run: | + # Turn our base64-encoded certificate back to a regular .p12 file + echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 - # We need to create a new keychain, otherwise using the certificate will prompt - # with a UI dialog asking for the certificate password, which we can't - # use in a headless CI environment - security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain - security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain + # We need to create a new keychain, otherwise using the certificate will prompt + # with a UI dialog asking for the certificate password, which we can't + # use in a headless CI environment + security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain + security default-keychain -s build.keychain + security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain + security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain - # We finally codesign our app bundle, specifying the Hardened runtime option - /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime macos/build/Release/Ghostty.app -v + # We finally codesign our app bundle, specifying the Hardened runtime option + /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime macos/build/Release/Ghostty.app -v - - name: "Notarize app bundle" - env: - PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }} - PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }} - PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }} - run: | - # Store the notarization credentials so that we can prevent a UI password dialog - # from blocking the CI - echo "Create keychain profile" - xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD" + - name: "Notarize app bundle" + env: + PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }} + PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }} + PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }} + run: | + # Store the notarization credentials so that we can prevent a UI password dialog + # from blocking the CI + echo "Create keychain profile" + xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD" - # We can't notarize an app bundle directly, but we need to compress it as an archive. - # Therefore, we create a zip file containing our app bundle, so that we can send it to the - # notarization service - echo "Creating temp notarization archive" - ditto -c -k --keepParent "macos/build/Release/Ghostty.app" "notarization.zip" + # We can't notarize an app bundle directly, but we need to compress it as an archive. + # Therefore, we create a zip file containing our app bundle, so that we can send it to the + # notarization service + echo "Creating temp notarization archive" + ditto -c -k --keepParent "macos/build/Release/Ghostty.app" "notarization.zip" - # Here we send the notarization request to the Apple's Notarization service, waiting for the result. - # This typically takes a few seconds inside a CI environment, but it might take more depending on the App - # characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if - # you're curious - echo "Notarize app" - xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait + # Here we send the notarization request to the Apple's Notarization service, waiting for the result. + # This typically takes a few seconds inside a CI environment, but it might take more depending on the App + # characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if + # you're curious + echo "Notarize app" + xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait - # Finally, we need to "attach the staple" to our executable, which will allow our app to be - # validated by macOS even when an internet connection is not available. - echo "Attach staple" - xcrun stapler staple "macos/build/Release/Ghostty.app" + # Finally, we need to "attach the staple" to our executable, which will allow our app to be + # validated by macOS even when an internet connection is not available. + echo "Attach staple" + xcrun stapler staple "macos/build/Release/Ghostty.app" - # Zip up the app - - name: Zip App - run: cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal.zip Ghostty.app + # Zip up the app + - name: Zip App + run: cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal.zip Ghostty.app - # Update Release - - name: Release - uses: softprops/action-gh-release@v1 - with: - name: "Ghostty Tip (\"Nightly\")" - prerelease: true - tag_name: tip - target_commitish: ${{ github.sha }} - files: ghostty-macos-universal.zip - token: ${{ secrets.GH_RELEASE_TOKEN }} + # Update Release + - name: Release + uses: softprops/action-gh-release@v1 + with: + name: 'Ghostty Tip ("Nightly")' + prerelease: true + tag_name: tip + target_commitish: ${{ github.sha }} + files: ghostty-macos-universal.zip + token: ${{ secrets.GH_RELEASE_TOKEN }} - # Update Blob Storage - - name: Upload to Blob Storage - run: | - s3cmd put ghostty-macos-universal.zip s3://ghostty-tip/${GHOSTTY_BUILD}/ghostty-macos-universal.zip + # Update Blob Storage + - name: Upload to Blob Storage + run: | + s3cmd put ghostty-macos-universal.zip s3://ghostty-tip/${GHOSTTY_BUILD}/ghostty-macos-universal.zip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bbea409b..5055907c7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,37 +8,36 @@ jobs: os: [ubuntu-latest] target: [ - aarch64-macos, - x86_64-macos, + aarch64-macos, + x86_64-macos, - aarch64-linux-gnu, - x86_64-linux-gnu, - - # No windows support currently. - # i386-windows, - # x86_64-windows-gnu, - ] + aarch64-linux-gnu, + x86_64-linux-gnu, + # No windows support currently. + # i386-windows, + # x86_64-windows-gnu, + ] runs-on: ${{ matrix.os }} needs: test env: # Needed for macos SDK AGREE: "true" steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 - # Install Nix and use that to run our tests so our environment matches exactly. - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-unstable + # Install Nix and use that to run our tests so our environment matches exactly. + - uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable - # Cross-compile the binary. We always use static building for this - # because its the only way to access the headers. - - name: Test Build - run: nix develop -c zig build -Dstatic=true -Dapp-runtime=glfw -Dtarget=${{ matrix.target }} + # Cross-compile the binary. We always use static building for this + # because its the only way to access the headers. + - name: Test Build + run: nix develop -c zig build -Dstatic=true -Dapp-runtime=glfw -Dtarget=${{ matrix.target }} build-macos: runs-on: macos-12 @@ -47,27 +46,27 @@ jobs: # Needed for macos SDK AGREE: "true" steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 - # Install Nix and use that to run our tests so our environment matches exactly. - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-unstable + # Install Nix and use that to run our tests so our environment matches exactly. + - uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable - # GhosttyKit is the framework that is built from Zig for our native - # Mac app to access. - - name: Build GhosttyKit - run: nix develop -c zig build -Dstatic=true + # GhosttyKit is the framework that is built from Zig for our native + # Mac app to access. + - name: Build GhosttyKit + run: nix develop -c zig build -Dstatic=true - # The native app is built with native XCode tooling. This also does - # codesigning. IMPORTANT: this must NOT run in a Nix environment. - # Nix breaks xcodebuild so this has to be run outside. - - name: Build Ghostty.app - run: cd macos && xcodebuild + # The native app is built with native XCode tooling. This also does + # codesigning. IMPORTANT: this must NOT run in a Nix environment. + # Nix breaks xcodebuild so this has to be run outside. + - name: Build Ghostty.app + run: cd macos && xcodebuild test: strategy: @@ -75,25 +74,25 @@ jobs: os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 - # Install Nix and use that to run our tests so our environment matches exactly. - - uses: cachix/install-nix-action@v23 - with: - nix_path: nixpkgs=channel:nixos-unstable + # Install Nix and use that to run our tests so our environment matches exactly. + - uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable - - name: test - run: nix develop -c zig build -Dapp-runtime=none test + - name: test + run: nix develop -c zig build -Dapp-runtime=none test - - name: Test GTK Build - run: nix develop -c zig build -Dapp-runtime=gtk + - name: Test GTK Build + run: nix develop -c zig build -Dapp-runtime=gtk - - name: Test GLFW Build - run: nix develop -c zig build -Dapp-runtime=glfw + - name: Test GLFW Build + run: nix develop -c zig build -Dapp-runtime=glfw - - name: Test Dynamic Build - run: nix develop -c zig build -Dstatic=false + - name: Test Dynamic Build + run: nix develop -c zig build -Dstatic=false diff --git a/com.mitchellh.ghostty.yml b/com.mitchellh.ghostty.yml index f92f4e99e..aa7785b27 100644 --- a/com.mitchellh.ghostty.yml +++ b/com.mitchellh.ghostty.yml @@ -3,7 +3,7 @@ # we want to keep _trying_ but its something with known issues. app-id: com.mitchellh.ghostty runtime: org.gnome.Platform -runtime-version: '43' +runtime-version: "43" sdk: org.gnome.Sdk default-branch: tip command: ghostty diff --git a/vendor/pixman/.gitlab-ci.yml b/vendor/pixman/.gitlab-ci.yml index 25c73df12..2a7b9bcee 100644 --- a/vendor/pixman/.gitlab-ci.yml +++ b/vendor/pixman/.gitlab-ci.yml @@ -1,19 +1,19 @@ image: fedora:28 autotools-build: - script: - - dnf -y install dnf-plugins-core - - dnf -y groupinstall buildsys-build - - dnf -y builddep pixman - - ./autogen.sh - - make -sj4 check + script: + - dnf -y install dnf-plugins-core + - dnf -y groupinstall buildsys-build + - dnf -y builddep pixman + - ./autogen.sh + - make -sj4 check meson-build: - script: - - dnf -y install dnf-plugins-core - - dnf -y groupinstall buildsys-build - - dnf -y builddep pixman - - dnf -y install ninja-build - - python3 -m pip install meson>=0.52.1 - - meson build - - ninja -C build test + script: + - dnf -y install dnf-plugins-core + - dnf -y groupinstall buildsys-build + - dnf -y builddep pixman + - dnf -y install ninja-build + - python3 -m pip install meson>=0.52.1 + - meson build + - ninja -C build test