From 7287ca6392581b1714312f27d4bd4609dc117be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 21 Oct 2025 10:49:19 +0200 Subject: [PATCH 1/6] Make a portable archive on Windows --- packages/eas-cli/src/build/utils/repository.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/eas-cli/src/build/utils/repository.ts b/packages/eas-cli/src/build/utils/repository.ts index eb41b23af0..a7c04b6673 100644 --- a/packages/eas-cli/src/build/utils/repository.ts +++ b/packages/eas-cli/src/build/utils/repository.ts @@ -143,9 +143,17 @@ export async function makeProjectTarballAsync(vcsClient: Client): Promise Date: Tue, 21 Oct 2025 10:52:04 +0200 Subject: [PATCH 2/6] Add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1742bc670a..4c6526dfd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes +- Strip permissions and other metadata from project archive when packing sources on Windows. ([#3234](https://github.com/expo/eas-cli/pull/3234) by [@sjchmiela](https://github.com/sjchmiela)) + ### ๐Ÿงน Chores - Document the default values for `track` and `releaseStatus`. ([#3229](https://github.com/expo/eas-cli/pull/3229) by [@kadikraman](https://github.com/kadikraman)) From 595834db52b60a30d4e6d67b4f1134f9127259f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 21 Oct 2025 10:57:53 +0200 Subject: [PATCH 3/6] Test --- .../workflows/test-tarball-cross-platform.yml | 248 ++++++++++++++++++ .../src/commands/build/test-tarball.ts | 54 ++++ 2 files changed, 302 insertions(+) create mode 100644 .github/workflows/test-tarball-cross-platform.yml create mode 100644 packages/eas-cli/src/commands/build/test-tarball.ts diff --git a/.github/workflows/test-tarball-cross-platform.yml b/.github/workflows/test-tarball-cross-platform.yml new file mode 100644 index 0000000000..2817fc7615 --- /dev/null +++ b/.github/workflows/test-tarball-cross-platform.yml @@ -0,0 +1,248 @@ +name: Test tarball cross-platform compatibility + +on: + pull_request: + paths: + - "packages/eas-cli/src/build/utils/repository.ts" + - ".github/workflows/test-tarball-cross-platform.yml" + workflow_dispatch: + +jobs: + create-tarball-windows: + name: Create tarball on Windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Setup git config + run: | + git config --global user.email "ci@expo.dev" + git config --global user.name "CI Test" + + - name: Create test git repository + run: | + mkdir test-project + cd test-project + git init + git config user.email "ci@expo.dev" + git config user.name "CI Test" + + # Create directory structure with files + New-Item -ItemType Directory -Force -Path src/api, src/app, src/assets + "console.log('api');" | Out-File -Encoding utf8 src/api/index.js + "console.log('app');" | Out-File -Encoding utf8 src/app/index.js + "/* asset */" | Out-File -Encoding utf8 src/assets/style.css + "test content" | Out-File -Encoding utf8 README.md + + git add . + git commit -m "Initial commit" + shell: pwsh + + - name: Build + run: yarn build + + - name: Create tarball + run: | + cd test-project + node ../bin/run build:test-tarball --output ../test-project.tar.gz + echo "Created tarball on Windows" + shell: pwsh + + - name: Upload tarball artifact + uses: actions/upload-artifact@v4 + with: + name: windows-tarball + path: test-project.tar.gz + retention-days: 1 + + test-extract-linux: + name: Extract and test on Linux + runs-on: ubuntu-latest + needs: create-tarball-windows + steps: + - name: Download tarball from Windows + uses: actions/download-artifact@v4 + with: + name: windows-tarball + + - name: Extract tarball + run: | + mkdir extracted + tar -C extracted --strip-components 1 -zxf test-project.tar.gz + echo "โœ… Extraction successful!" + + - name: Verify directory structure + run: | + cd extracted + if [ ! -d "src/api" ]; then + echo "โŒ src/api directory not found" + exit 1 + fi + if [ ! -d "src/app" ]; then + echo "โŒ src/app directory not found" + exit 1 + fi + if [ ! -d "src/assets" ]; then + echo "โŒ src/assets directory not found" + exit 1 + fi + echo "โœ… All directories extracted successfully" + + - name: Verify files are readable + run: | + cd extracted + cat src/api/index.js + cat src/app/index.js + cat src/assets/style.css + cat package.json + echo "โœ… All files are readable" + + - name: List permissions + run: | + cd extracted + ls -la + ls -la src/ + ls -la src/api/ + ls -la src/app/ + ls -la src/assets/ + + test-extract-macos: + name: Extract and test on macOS + runs-on: macos-latest + needs: create-tarball-windows + steps: + - name: Download tarball from Windows + uses: actions/download-artifact@v4 + with: + name: windows-tarball + + - name: Extract tarball + run: | + mkdir extracted + tar -C extracted --strip-components 1 -zxf test-project.tar.gz + echo "โœ… Extraction successful!" + + - name: Verify directory structure + run: | + cd extracted + if [ ! -d "src/api" ]; then + echo "โŒ src/api directory not found" + exit 1 + fi + if [ ! -d "src/app" ]; then + echo "โŒ src/app directory not found" + exit 1 + fi + if [ ! -d "src/assets" ]; then + echo "โŒ src/assets directory not found" + exit 1 + fi + echo "โœ… All directories extracted successfully" + + - name: Verify files are readable + run: | + cd extracted + cat src/api/index.js + cat src/app/index.js + cat src/assets/style.css + cat package.json + echo "โœ… All files are readable" + + # Also test that Unix-created tarballs preserve permissions + create-tarball-linux: + name: Create tarball on Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Setup git config + run: | + git config --global user.email "ci@expo.dev" + git config --global user.name "CI Test" + + - name: Create test git repository with executable files + run: | + mkdir test-project-linux + cd test-project-linux + git init + git config user.email "ci@expo.dev" + git config user.name "CI Test" + + # Create directory structure + mkdir -p src/api src/app scripts + echo "console.log('api');" > src/api/index.js + echo "console.log('app');" > src/app/index.js + + # Create an executable script + cat > scripts/build.sh << 'EOF' + #!/bin/bash + echo "Building..." + EOF + chmod +x scripts/build.sh + + echo "test content" > README.md + + git add . + git commit -m "Initial commit" + + - name: Build + run: yarn build + + - name: Create tarball + run: | + cd test-project-linux + node ../bin/run build:test-tarball --output ../test-project-linux.tar.gz + + - name: Upload tarball artifact + uses: actions/upload-artifact@v4 + with: + name: linux-tarball + path: test-project-linux.tar.gz + retention-days: 1 + + verify-linux-permissions: + name: Verify Linux tarball preserves executable permissions + runs-on: ubuntu-latest + needs: create-tarball-linux + steps: + - name: Download tarball from Linux + uses: actions/download-artifact@v4 + with: + name: linux-tarball + + - name: Extract tarball + run: | + mkdir extracted + tar -C extracted --strip-components 1 -zxf test-project-linux.tar.gz + + - name: Verify executable permissions are preserved + run: | + cd extracted + if [ ! -x "scripts/build.sh" ]; then + echo "โŒ scripts/build.sh is not executable!" + ls -la scripts/build.sh + exit 1 + fi + echo "โœ… Executable permissions preserved!" + ls -la scripts/build.sh + + - name: Test executing the script + run: | + cd extracted + ./scripts/build.sh diff --git a/packages/eas-cli/src/commands/build/test-tarball.ts b/packages/eas-cli/src/commands/build/test-tarball.ts new file mode 100644 index 0000000000..3b1cd6a97d --- /dev/null +++ b/packages/eas-cli/src/commands/build/test-tarball.ts @@ -0,0 +1,54 @@ +import { Command, Flags } from '@oclif/core'; +import fs from 'fs-extra'; + +import { makeProjectTarballAsync } from '../../build/utils/repository'; +import GitClient from '../../vcs/clients/git'; + +/** + * Test command to create a project tarball and verify it works cross-platform. + * Used in CI to test that archives created on Windows can be extracted on Unix/Linux. + * Does not require an Expo project - works with any git repository. + */ +export default class BuildTestTarball extends Command { + static override hidden = true; + static override description = 'Create a project tarball for testing cross-platform compatibility'; + + static override flags = { + output: Flags.string({ + description: 'Output path for the tarball', + required: false, + }), + cwd: Flags.string({ + description: 'Working directory (defaults to current directory)', + required: false, + }), + }; + + async run(): Promise { + const { flags } = await this.parse(BuildTestTarball); + const cwd = flags.cwd ?? process.cwd(); + + this.log(`Creating project tarball from ${cwd}...`); + this.log(`Platform: ${process.platform}`); + + const vcsClient = new GitClient({ + maybeCwdOverride: cwd, + requireCommit: false, + }); + + const { path: tarballPath, size } = await makeProjectTarballAsync(vcsClient); + + this.log(`โœ… Tarball created successfully: ${tarballPath}`); + this.log(`Size: ${(size / 1024 / 1024).toFixed(2)} MB`); + + if (flags.output) { + await fs.copy(tarballPath, flags.output); + this.log(`Copied to: ${flags.output}`); + // Output just the path for easy consumption in CI + console.log(flags.output); + } else { + // Output the path for easy consumption in CI + console.log(tarballPath); + } + } +} From c041e9142264c9b362489d11cd0d2e402f8450ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 21 Oct 2025 11:10:57 +0200 Subject: [PATCH 4/6] More test --- .../workflows/test-tarball-cross-platform.yml | 24 +++------------ packages/eas-cli/package.json | 2 +- packages/eas-cli/scripts/copy-templates.js | 29 +++++++++++++++++++ 3 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 packages/eas-cli/scripts/copy-templates.js diff --git a/.github/workflows/test-tarball-cross-platform.yml b/.github/workflows/test-tarball-cross-platform.yml index 2817fc7615..36fa4f5a3c 100644 --- a/.github/workflows/test-tarball-cross-platform.yml +++ b/.github/workflows/test-tarball-cross-platform.yml @@ -22,11 +22,6 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile - - name: Setup git config - run: | - git config --global user.email "ci@expo.dev" - git config --global user.name "CI Test" - - name: Create test git repository run: | mkdir test-project @@ -46,13 +41,10 @@ jobs: git commit -m "Initial commit" shell: pwsh - - name: Build - run: yarn build - - - name: Create tarball + - name: Create tarball using dev script (no build needed) run: | cd test-project - node ../bin/run build:test-tarball --output ../test-project.tar.gz + node ../packages/eas-cli/bin/dev build:test-tarball --output ../test-project.tar.gz echo "Created tarball on Windows" shell: pwsh @@ -171,11 +163,6 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile - - name: Setup git config - run: | - git config --global user.email "ci@expo.dev" - git config --global user.name "CI Test" - - name: Create test git repository with executable files run: | mkdir test-project-linux @@ -201,13 +188,10 @@ jobs: git add . git commit -m "Initial commit" - - name: Build - run: yarn build - - - name: Create tarball + - name: Create tarball using dev script (no build needed) run: | cd test-project-linux - node ../bin/run build:test-tarball --output ../test-project-linux.tar.gz + node ../packages/eas-cli/bin/dev build:test-tarball --output ../test-project-linux.tar.gz - name: Upload tarball artifact uses: actions/upload-artifact@v4 diff --git a/packages/eas-cli/package.json b/packages/eas-cli/package.json index 00a8c2af60..e977ca900a 100644 --- a/packages/eas-cli/package.json +++ b/packages/eas-cli/package.json @@ -236,7 +236,7 @@ "generate-graphql-code": "graphql-codegen --config graphql-codegen.yml", "verify-graphql-code": "./scripts/verify-graphql.sh", "clean": "rimraf dist build tmp node_modules yarn-error.log", - "copy-new-templates": "rimraf build/commandUtils/new/templates && mkdir -p build/commandUtils/new && cp -r src/commandUtils/new/templates build/commandUtils/new" + "copy-new-templates": "node scripts/copy-templates.js" }, "volta": { "node": "20.11.0", diff --git a/packages/eas-cli/scripts/copy-templates.js b/packages/eas-cli/scripts/copy-templates.js new file mode 100644 index 0000000000..8d8413e087 --- /dev/null +++ b/packages/eas-cli/scripts/copy-templates.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +/** + * Cross-platform script to copy template files from src to build directory. + * Replaces the Unix-only "cp -r" and "mkdir -p" commands. + */ + +const fs = require('fs-extra'); +const path = require('path'); + +const buildTemplatesDir = path.join(__dirname, '..', 'build', 'commandUtils', 'new', 'templates'); +const srcTemplatesDir = path.join(__dirname, '..', 'src', 'commandUtils', 'new', 'templates'); + +async function copyTemplates() { + try { + // Remove existing build/commandUtils/new/templates if it exists + await fs.remove(buildTemplatesDir); + + // Copy src/commandUtils/new/templates to build/commandUtils/new/templates + await fs.copy(srcTemplatesDir, buildTemplatesDir); + + console.log('โœ“ Templates copied successfully'); + } catch (error) { + console.error('Error copying templates:', error); + process.exit(1); + } +} + +copyTemplates(); From 3d66d690c27f94993ce75b69323fed9ff0311816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 21 Oct 2025 11:29:46 +0200 Subject: [PATCH 5/6] Revert "More test" This reverts commit c041e9142264c9b362489d11cd0d2e402f8450ae. --- .../workflows/test-tarball-cross-platform.yml | 24 ++++++++++++--- packages/eas-cli/package.json | 2 +- packages/eas-cli/scripts/copy-templates.js | 29 ------------------- 3 files changed, 21 insertions(+), 34 deletions(-) delete mode 100644 packages/eas-cli/scripts/copy-templates.js diff --git a/.github/workflows/test-tarball-cross-platform.yml b/.github/workflows/test-tarball-cross-platform.yml index 36fa4f5a3c..2817fc7615 100644 --- a/.github/workflows/test-tarball-cross-platform.yml +++ b/.github/workflows/test-tarball-cross-platform.yml @@ -22,6 +22,11 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile + - name: Setup git config + run: | + git config --global user.email "ci@expo.dev" + git config --global user.name "CI Test" + - name: Create test git repository run: | mkdir test-project @@ -41,10 +46,13 @@ jobs: git commit -m "Initial commit" shell: pwsh - - name: Create tarball using dev script (no build needed) + - name: Build + run: yarn build + + - name: Create tarball run: | cd test-project - node ../packages/eas-cli/bin/dev build:test-tarball --output ../test-project.tar.gz + node ../bin/run build:test-tarball --output ../test-project.tar.gz echo "Created tarball on Windows" shell: pwsh @@ -163,6 +171,11 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile + - name: Setup git config + run: | + git config --global user.email "ci@expo.dev" + git config --global user.name "CI Test" + - name: Create test git repository with executable files run: | mkdir test-project-linux @@ -188,10 +201,13 @@ jobs: git add . git commit -m "Initial commit" - - name: Create tarball using dev script (no build needed) + - name: Build + run: yarn build + + - name: Create tarball run: | cd test-project-linux - node ../packages/eas-cli/bin/dev build:test-tarball --output ../test-project-linux.tar.gz + node ../bin/run build:test-tarball --output ../test-project-linux.tar.gz - name: Upload tarball artifact uses: actions/upload-artifact@v4 diff --git a/packages/eas-cli/package.json b/packages/eas-cli/package.json index e977ca900a..00a8c2af60 100644 --- a/packages/eas-cli/package.json +++ b/packages/eas-cli/package.json @@ -236,7 +236,7 @@ "generate-graphql-code": "graphql-codegen --config graphql-codegen.yml", "verify-graphql-code": "./scripts/verify-graphql.sh", "clean": "rimraf dist build tmp node_modules yarn-error.log", - "copy-new-templates": "node scripts/copy-templates.js" + "copy-new-templates": "rimraf build/commandUtils/new/templates && mkdir -p build/commandUtils/new && cp -r src/commandUtils/new/templates build/commandUtils/new" }, "volta": { "node": "20.11.0", diff --git a/packages/eas-cli/scripts/copy-templates.js b/packages/eas-cli/scripts/copy-templates.js deleted file mode 100644 index 8d8413e087..0000000000 --- a/packages/eas-cli/scripts/copy-templates.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node - -/** - * Cross-platform script to copy template files from src to build directory. - * Replaces the Unix-only "cp -r" and "mkdir -p" commands. - */ - -const fs = require('fs-extra'); -const path = require('path'); - -const buildTemplatesDir = path.join(__dirname, '..', 'build', 'commandUtils', 'new', 'templates'); -const srcTemplatesDir = path.join(__dirname, '..', 'src', 'commandUtils', 'new', 'templates'); - -async function copyTemplates() { - try { - // Remove existing build/commandUtils/new/templates if it exists - await fs.remove(buildTemplatesDir); - - // Copy src/commandUtils/new/templates to build/commandUtils/new/templates - await fs.copy(srcTemplatesDir, buildTemplatesDir); - - console.log('โœ“ Templates copied successfully'); - } catch (error) { - console.error('Error copying templates:', error); - process.exit(1); - } -} - -copyTemplates(); From 60a9cef8e437034aba2eadef9f1f790b493d173f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Tue, 21 Oct 2025 11:29:49 +0200 Subject: [PATCH 6/6] Revert "Test" This reverts commit 595834db52b60a30d4e6d67b4f1134f9127259f2. --- .../workflows/test-tarball-cross-platform.yml | 248 ------------------ .../src/commands/build/test-tarball.ts | 54 ---- 2 files changed, 302 deletions(-) delete mode 100644 .github/workflows/test-tarball-cross-platform.yml delete mode 100644 packages/eas-cli/src/commands/build/test-tarball.ts diff --git a/.github/workflows/test-tarball-cross-platform.yml b/.github/workflows/test-tarball-cross-platform.yml deleted file mode 100644 index 2817fc7615..0000000000 --- a/.github/workflows/test-tarball-cross-platform.yml +++ /dev/null @@ -1,248 +0,0 @@ -name: Test tarball cross-platform compatibility - -on: - pull_request: - paths: - - "packages/eas-cli/src/build/utils/repository.ts" - - ".github/workflows/test-tarball-cross-platform.yml" - workflow_dispatch: - -jobs: - create-tarball-windows: - name: Create tarball on Windows - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Setup git config - run: | - git config --global user.email "ci@expo.dev" - git config --global user.name "CI Test" - - - name: Create test git repository - run: | - mkdir test-project - cd test-project - git init - git config user.email "ci@expo.dev" - git config user.name "CI Test" - - # Create directory structure with files - New-Item -ItemType Directory -Force -Path src/api, src/app, src/assets - "console.log('api');" | Out-File -Encoding utf8 src/api/index.js - "console.log('app');" | Out-File -Encoding utf8 src/app/index.js - "/* asset */" | Out-File -Encoding utf8 src/assets/style.css - "test content" | Out-File -Encoding utf8 README.md - - git add . - git commit -m "Initial commit" - shell: pwsh - - - name: Build - run: yarn build - - - name: Create tarball - run: | - cd test-project - node ../bin/run build:test-tarball --output ../test-project.tar.gz - echo "Created tarball on Windows" - shell: pwsh - - - name: Upload tarball artifact - uses: actions/upload-artifact@v4 - with: - name: windows-tarball - path: test-project.tar.gz - retention-days: 1 - - test-extract-linux: - name: Extract and test on Linux - runs-on: ubuntu-latest - needs: create-tarball-windows - steps: - - name: Download tarball from Windows - uses: actions/download-artifact@v4 - with: - name: windows-tarball - - - name: Extract tarball - run: | - mkdir extracted - tar -C extracted --strip-components 1 -zxf test-project.tar.gz - echo "โœ… Extraction successful!" - - - name: Verify directory structure - run: | - cd extracted - if [ ! -d "src/api" ]; then - echo "โŒ src/api directory not found" - exit 1 - fi - if [ ! -d "src/app" ]; then - echo "โŒ src/app directory not found" - exit 1 - fi - if [ ! -d "src/assets" ]; then - echo "โŒ src/assets directory not found" - exit 1 - fi - echo "โœ… All directories extracted successfully" - - - name: Verify files are readable - run: | - cd extracted - cat src/api/index.js - cat src/app/index.js - cat src/assets/style.css - cat package.json - echo "โœ… All files are readable" - - - name: List permissions - run: | - cd extracted - ls -la - ls -la src/ - ls -la src/api/ - ls -la src/app/ - ls -la src/assets/ - - test-extract-macos: - name: Extract and test on macOS - runs-on: macos-latest - needs: create-tarball-windows - steps: - - name: Download tarball from Windows - uses: actions/download-artifact@v4 - with: - name: windows-tarball - - - name: Extract tarball - run: | - mkdir extracted - tar -C extracted --strip-components 1 -zxf test-project.tar.gz - echo "โœ… Extraction successful!" - - - name: Verify directory structure - run: | - cd extracted - if [ ! -d "src/api" ]; then - echo "โŒ src/api directory not found" - exit 1 - fi - if [ ! -d "src/app" ]; then - echo "โŒ src/app directory not found" - exit 1 - fi - if [ ! -d "src/assets" ]; then - echo "โŒ src/assets directory not found" - exit 1 - fi - echo "โœ… All directories extracted successfully" - - - name: Verify files are readable - run: | - cd extracted - cat src/api/index.js - cat src/app/index.js - cat src/assets/style.css - cat package.json - echo "โœ… All files are readable" - - # Also test that Unix-created tarballs preserve permissions - create-tarball-linux: - name: Create tarball on Linux - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Setup git config - run: | - git config --global user.email "ci@expo.dev" - git config --global user.name "CI Test" - - - name: Create test git repository with executable files - run: | - mkdir test-project-linux - cd test-project-linux - git init - git config user.email "ci@expo.dev" - git config user.name "CI Test" - - # Create directory structure - mkdir -p src/api src/app scripts - echo "console.log('api');" > src/api/index.js - echo "console.log('app');" > src/app/index.js - - # Create an executable script - cat > scripts/build.sh << 'EOF' - #!/bin/bash - echo "Building..." - EOF - chmod +x scripts/build.sh - - echo "test content" > README.md - - git add . - git commit -m "Initial commit" - - - name: Build - run: yarn build - - - name: Create tarball - run: | - cd test-project-linux - node ../bin/run build:test-tarball --output ../test-project-linux.tar.gz - - - name: Upload tarball artifact - uses: actions/upload-artifact@v4 - with: - name: linux-tarball - path: test-project-linux.tar.gz - retention-days: 1 - - verify-linux-permissions: - name: Verify Linux tarball preserves executable permissions - runs-on: ubuntu-latest - needs: create-tarball-linux - steps: - - name: Download tarball from Linux - uses: actions/download-artifact@v4 - with: - name: linux-tarball - - - name: Extract tarball - run: | - mkdir extracted - tar -C extracted --strip-components 1 -zxf test-project-linux.tar.gz - - - name: Verify executable permissions are preserved - run: | - cd extracted - if [ ! -x "scripts/build.sh" ]; then - echo "โŒ scripts/build.sh is not executable!" - ls -la scripts/build.sh - exit 1 - fi - echo "โœ… Executable permissions preserved!" - ls -la scripts/build.sh - - - name: Test executing the script - run: | - cd extracted - ./scripts/build.sh diff --git a/packages/eas-cli/src/commands/build/test-tarball.ts b/packages/eas-cli/src/commands/build/test-tarball.ts deleted file mode 100644 index 3b1cd6a97d..0000000000 --- a/packages/eas-cli/src/commands/build/test-tarball.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Command, Flags } from '@oclif/core'; -import fs from 'fs-extra'; - -import { makeProjectTarballAsync } from '../../build/utils/repository'; -import GitClient from '../../vcs/clients/git'; - -/** - * Test command to create a project tarball and verify it works cross-platform. - * Used in CI to test that archives created on Windows can be extracted on Unix/Linux. - * Does not require an Expo project - works with any git repository. - */ -export default class BuildTestTarball extends Command { - static override hidden = true; - static override description = 'Create a project tarball for testing cross-platform compatibility'; - - static override flags = { - output: Flags.string({ - description: 'Output path for the tarball', - required: false, - }), - cwd: Flags.string({ - description: 'Working directory (defaults to current directory)', - required: false, - }), - }; - - async run(): Promise { - const { flags } = await this.parse(BuildTestTarball); - const cwd = flags.cwd ?? process.cwd(); - - this.log(`Creating project tarball from ${cwd}...`); - this.log(`Platform: ${process.platform}`); - - const vcsClient = new GitClient({ - maybeCwdOverride: cwd, - requireCommit: false, - }); - - const { path: tarballPath, size } = await makeProjectTarballAsync(vcsClient); - - this.log(`โœ… Tarball created successfully: ${tarballPath}`); - this.log(`Size: ${(size / 1024 / 1024).toFixed(2)} MB`); - - if (flags.output) { - await fs.copy(tarballPath, flags.output); - this.log(`Copied to: ${flags.output}`); - // Output just the path for easy consumption in CI - console.log(flags.output); - } else { - // Output the path for easy consumption in CI - console.log(tarballPath); - } - } -}