Repository navigation
Fix TUI native release runtime #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| tui-native: | |
| name: TUI native (${{ matrix.package }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| package: albert_tesla__mebius-code-linux-x64 | |
| executable: mebius | |
| expected_arch: x86_64 | |
| - os: macos-15-intel | |
| package: albert_tesla__mebius-code-darwin-x64 | |
| executable: mebius | |
| expected_arch: x86_64 | |
| - os: macos-15 | |
| package: albert_tesla__mebius-code-darwin-arm64 | |
| executable: mebius | |
| expected_arch: arm64 | |
| - os: windows-latest | |
| package: albert_tesla__mebius-code-win32-x64 | |
| executable: mebius.exe | |
| expected_arch: AMD64 | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| working-directory: tui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: tui/package-lock.json | |
| - name: Check runner architecture | |
| shell: bash | |
| run: | | |
| actual="$(uname -m)" | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then actual="$PROCESSOR_ARCHITECTURE"; fi | |
| test "$actual" = "${{ matrix.expected_arch }}" | |
| - run: npm ci --ignore-scripts | |
| - run: npm run typecheck | |
| - run: bun test | |
| - name: Install Linux musl OpenTUI package for Bun compile | |
| if: matrix.package == 'albert_tesla__mebius-code-linux-x64' | |
| shell: bash | |
| run: | | |
| opentui_version="$(node -p "require('./node_modules/@opentui/core/package.json').version")" | |
| package_archive="$(npm pack --silent "@opentui/core-linux-x64-musl@$opentui_version")" | |
| mkdir -p node_modules/@opentui/core-linux-x64-musl | |
| tar -xzf "$package_archive" -C node_modules/@opentui/core-linux-x64-musl --strip-components=1 | |
| - name: Build native binary | |
| shell: bash | |
| run: | | |
| mkdir -p dist/native | |
| bun ./scripts/build-native.ts --outfile "dist/native/${{ matrix.executable }}" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.package }} | |
| path: tui/dist/native/** | |
| npm: | |
| name: Publish npm packages | |
| runs-on: ubuntu-latest | |
| needs: | |
| - tui-native | |
| defaults: | |
| run: | |
| working-directory: tui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org | |
| cache: npm | |
| cache-dependency-path: tui/package-lock.json | |
| - run: npm ci --ignore-scripts --omit=optional | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: tui/dist/native-artifacts | |
| - run: npm run stage:npm | |
| - name: Check npm token | |
| run: test -n "$NODE_AUTH_TOKEN" | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish platform packages | |
| run: | | |
| for package in \ | |
| albert_tesla__mebius-code-win32-x64 \ | |
| albert_tesla__mebius-code-linux-x64 \ | |
| albert_tesla__mebius-code-darwin-x64 \ | |
| albert_tesla__mebius-code-darwin-arm64 | |
| do | |
| npm publish "dist/npm/$package" --access public | |
| done | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish main package | |
| run: npm publish dist/npm/mebius-code --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |