From b25adb3bdf487e93ceea281c61d663dbed29ff02 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 27 Feb 2023 14:54:44 -0800 Subject: [PATCH] ci: clean artifacts, move flatpak to release tip --- .github/workflows/clean-artifacts.yml | 17 +++++++++++ .github/workflows/flatpak.yml | 36 ---------------------- .github/workflows/release-tip.yml | 44 +++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/clean-artifacts.yml delete mode 100644 .github/workflows/flatpak.yml diff --git a/.github/workflows/clean-artifacts.yml b/.github/workflows/clean-artifacts.yml new file mode 100644 index 000000000..cb6864b23 --- /dev/null +++ b/.github/workflows/clean-artifacts.yml @@ -0,0 +1,17 @@ +name: Clean Artifacts +on: + schedule: + # Every 6 hours + - cron: '0 */6 * * *' + 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 diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml deleted file mode 100644 index a30639b83..000000000 --- a/.github/workflows/flatpak.yml +++ /dev/null @@ -1,36 +0,0 @@ -on: [push] - -name: Flatpak - -jobs: - flatpak: - name: "Flatpak" - runs-on: ubuntu-latest - container: - image: bilelmoussaoui/flatpak-github-actions:gnome-43 - options: --privileged - strategy: - fail-fast: false - matrix: - arch: [x86_64, aarch64] - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - # Docker is required by the docker/setup-qemu-action which enables emulation - - name: Install deps - run: | - dnf -y install docker - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64 - - uses: flatpak/flatpak-github-actions/flatpak-builder@v4 - with: - bundle: ghostty.flatpak - manifest-path: com.mitchellh.ghostty.yml - branch: tip - cache-key: flatpak-builder-${{ matrix.arch }}-${{ github.sha }}-v1 - arch: ${{ matrix.arch }} diff --git a/.github/workflows/release-tip.yml b/.github/workflows/release-tip.yml index eaeb3f1f5..cbf0a1c7f 100644 --- a/.github/workflows/release-tip.yml +++ b/.github/workflows/release-tip.yml @@ -9,6 +9,50 @@ on: name: Release Tip jobs: + flatpak: + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-43 + options: --privileged + strategy: + fail-fast: false + matrix: + arch: [x86_64, aarch64] + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + # Docker is required by the docker/setup-qemu-action which enables emulation + - name: Install deps + run: | + dnf -y install docker + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 + + - uses: flatpak/flatpak-github-actions/flatpak-builder@v4 + with: + bundle: ghostty.flatpak + manifest-path: com.mitchellh.ghostty.yml + branch: tip + cache-key: flatpak-builder-${{ matrix.arch }}-${{ github.sha }}-v1 + arch: ${{ matrix.arch }} + + - name: Rename Bundle + run: mv ghostty.flatpak ghostty-${{ matrix.arch }}.flatpak + - name: Release + uses: softprops/action-gh-release@v1 + with: + name: "Ghostty Tip (\"Nightly\")" + prerelease: true + tag_name: tip + target_commitish: ${{ github.sha }} + files: ghostty-${{ matrix.arch }}.flatpak + build-macos: if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} runs-on: macos-12