Skip to content

Commit 3f2f7a6

Browse files
authored
Merge pull request #12365 from gitbutlerapp/GB-1049/update-install.sh-for-linux
fix(install.sh): update install script to support Linux
2 parents 7ad4653 + 425130d commit 3f2f7a6

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

.github/workflows/push.yaml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
ui: ${{ steps.filter.outputs.ui }}
2222
docs: ${{ steps.filter.outputs.docs }}
2323
but_installer: ${{ steps.filter.outputs.but_installer }}
24+
install_script: ${{ steps.filter.outputs.install_script }}
2425
steps:
2526
- uses: actions/checkout@v6
2627
with:
@@ -53,6 +54,8 @@ jobs:
5354
- 'Cargo.lock'
5455
- 'Cargo.toml'
5556
- 'crates/but-installer/**'
57+
install_script:
58+
- 'scripts/install.sh'
5659
5760
prettier:
5861
needs: changes
@@ -320,7 +323,8 @@ jobs:
320323
retention-days: 7
321324

322325
fetch-published-versions:
323-
needs: build-installer
326+
needs: changes
327+
if: ${{ needs.changes.outputs.install_script == 'true' || needs.changes.outputs.but_installer == 'true' }}
324328
runs-on: ubuntu-22.04
325329
permissions:
326330
contents: none
@@ -334,6 +338,37 @@ jobs:
334338
echo "release_version=$(curl -s https://app.gitbutler.com/releases | jq -r .version)" >> $GITHUB_OUTPUT
335339
echo "nightly_version=$(curl -s https://app.gitbutler.com/releases/nightly | jq -r .version)" >> $GITHUB_OUTPUT
336340
341+
validate-install-script:
342+
needs:
343+
- changes
344+
- fetch-published-versions
345+
if: ${{ needs.changes.outputs.install_script == 'true' }}
346+
permissions:
347+
contents: read
348+
env:
349+
LATEST_RELEASE_VERSION: ${{ needs.fetch-published-versions.outputs.release_version }}
350+
LATEST_NIGHTLY_VERSION: ${{ needs.fetch-published-versions.outputs.nightly_version }}
351+
strategy:
352+
fail-fast: false
353+
matrix:
354+
include:
355+
- platform: macos-15 # [macOs, ARM64] - default target
356+
- platform: ubuntu-22.04 # [linux, x64]
357+
- platform: ubuntu-22.04-arm # [linux, ARM64]
358+
runs-on: ${{ matrix.platform }}
359+
steps:
360+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
361+
with:
362+
persist-credentials: false
363+
- name: Install release
364+
run: ./scripts/install.sh
365+
- name: Validate release version
366+
run: but --version | grep "but $LATEST_RELEASE_VERSION"
367+
- name: Install nightly
368+
run: ./scripts/install.sh nightly
369+
- name: Validate nightly version
370+
run: but --version | grep "but $LATEST_NIGHTLY_VERSION"
371+
337372
validate-installer:
338373
needs:
339374
- build-installer

scripts/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ ARCH=$(uname -m)
1919
# Map OS to installer format
2020
case "$OS" in
2121
"darwin") INSTALLER_OS="macos" ;;
22+
"linux") INSTALLER_OS="linux" ;;
2223
*)
23-
echo "Error: This installer currently only supports macOS. Your OS: $OS" >&2
24+
echo "Error: This installer currently only supports macOS and Linux. Your OS: $OS" >&2
2425
exit 1
2526
;;
2627
esac

0 commit comments

Comments
 (0)