Skip to content

Commit

Permalink
Use SEA support in pkg and avoid building again in all the E2E jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
timrogers committed Nov 28, 2024
1 parent 720d61c commit 53d51bd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 65 deletions.
99 changes: 36 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ jobs:
end_to_end_tests_linux:
name: Run end to end tests (GitHub.com to GitHub.com on Linux)
runs-on: ubuntu-latest
requires: ['package']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.1.0
- name: Download Linux AMD64 binary
uses: actions/download-artifact@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- name: Generate binaries for macOS, Linux and Windows
run: npm run package
- name: Rename Linux binary to conform to GitHub CLI extension rules
run: mv bin/migrate-project-linux bin/gh-migrate-project-linux-amd64
name: gh-migrate-project-linux-amd64
path: bin
- name: Create `output` directory
run: mkdir output
- name: Make Linux binary executable
Expand Down Expand Up @@ -100,16 +96,13 @@ jobs:
name: Run end to end tests (GitHub.com to GitHub.com on Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
requires: ['package']
steps:
- name: Download Windows AMD64 binary
uses: actions/download-artifact@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- name: Generate binaries for macOS, Linux and Windows
run: npm run package
- name: Rename Windows binary to conform to GitHub CLI extension rules
run: mv bin/migrate-project-win.exe bin/gh-migrate-project-windows-amd64.exe
name: gh-migrate-project-windows-amd64
path: bin
- name: Create `output` directory
run: mkdir output
- name: Export a project from GitHub.com
Expand Down Expand Up @@ -138,17 +131,13 @@ jobs:
end_to_end_tests_linux_ghes_315:
name: Run end to end tests (GitHub.com to GHES v3.15 on Linux)
runs-on: ubuntu-latest
needs: ['package']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.1.0
- name: Download Linux AMD64 binary
uses: actions/download-artifact@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- name: Generate binaries for macOS, Linux and Windows
run: npm run package
- name: Rename Linux binary to conform to GitHub CLI extension rules
run: mv bin/migrate-project-linux bin/gh-migrate-project-linux-amd64
name: gh-migrate-project-linux-amd64
path: bin
- name: Create `output` directory
run: mkdir output
- name: Make Linux binary executable
Expand Down Expand Up @@ -179,17 +168,13 @@ jobs:
end_to_end_tests_linux_ghes_314:
name: Run end to end tests (GitHub.com to GHES v3.14 on Linux)
runs-on: ubuntu-latest
needs: ['package']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.1.0
- name: Download Linux AMD64 binary
uses: actions/download-artifact@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- name: Generate binaries for macOS, Linux and Windows
run: npm run package
- name: Rename Linux binary to conform to GitHub CLI extension rules
run: mv bin/migrate-project-linux bin/gh-migrate-project-linux-amd64
name: gh-migrate-project-linux-amd64
path: bin
- name: Create `output` directory
run: mkdir output
- name: Make Linux binary executable
Expand Down Expand Up @@ -220,17 +205,13 @@ jobs:
end_to_end_tests_linux_ghes_313:
name: Run end to end tests (GitHub.com to GHES v3.13 on Linux)
runs-on: ubuntu-latest
needs: ['package']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.1.0
- name: Download Linux AMD64 binary
uses: actions/download-artifact@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- name: Generate binaries for macOS, Linux and Windows
run: npm run package
- name: Rename Linux binary to conform to GitHub CLI extension rules
run: mv bin/migrate-project-linux bin/gh-migrate-project-linux-amd64
name: gh-migrate-project-linux-amd64
path: bin
- name: Create `output` directory
run: mkdir output
- name: Make Linux binary executable
Expand Down Expand Up @@ -261,17 +242,13 @@ jobs:
end_to_end_tests_linux_ghes_312:
name: Run end to end tests (GitHub.com to GHES v3.12 on Linux)
runs-on: ubuntu-latest
needs: ['package']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.1.0
- name: Download Linux AMD64 binary
uses: actions/download-artifact@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- name: Generate binaries for macOS, Linux and Windows
run: npm run package
- name: Rename Linux binary to conform to GitHub CLI extension rules
run: mv bin/migrate-project-linux bin/gh-migrate-project-linux-amd64
name: gh-migrate-project-linux-amd64
path: bin
- name: Create `output` directory
run: mkdir output
- name: Make Linux binary executable
Expand Down Expand Up @@ -302,17 +279,13 @@ jobs:
end_to_end_tests_linux_ghes_311:
name: Run end to end tests (GitHub.com to GHES v3.11 on Linux)
runs-on: ubuntu-latest
needs: ['package']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.1.0
- name: Download Linux AMD64 binary
uses: actions/download-artifact@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- name: Generate binaries for macOS, Linux and Windows
run: npm run package
- name: Rename Linux binary to conform to GitHub CLI extension rules
run: mv bin/migrate-project-linux bin/gh-migrate-project-linux-amd64
name: gh-migrate-project-linux-amd64
path: bin
- name: Create `output` directory
run: mkdir output
- name: Make Linux binary executable
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"description": "A GitHub CLI (https://cli.github.com/) extension for migrating GitHub Projects (https://docs.github.com/en/issues/planning-and-tracking-with-projects) between GitHub accounts and products",
"homepage": "https://github.com/timrogers/gh-migrate-project",
"scripts": {
"package": "node build.js && npx pkg dist/migrate-project.cjs --out-path bin --targets node20-linux-x64,node20-win-x64",
"package:macos": "node build.js && npx pkg dist/migrate-project.cjs --out-path bin --targets node20-macos-x64,node20-macos-arm64",
"package": "node build.js && npx pkg dist/migrate-project.cjs --sea --out-path bin --targets node20-linux-x64,node20-win-x64",
"package:macos": "node build.js && npx pkg dist/migrate-project.cjs --sea --targets node20-macos-x64,node20-macos-arm64 --out-path bin",
"lint": "eslint ",
"lint-and-fix": "eslint . --fix",
"dev": "npx tsx --esm src/index.ts",
Expand Down

0 comments on commit 53d51bd

Please sign in to comment.