|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + id-token: write |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + name: Build - ${{ matrix.target }} |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + include: |
| 24 | + - target: x86_64-unknown-linux-gnu |
| 25 | + os: ubuntu-latest |
| 26 | + - target: aarch64-unknown-linux-gnu |
| 27 | + os: ubuntu-latest |
| 28 | + - target: x86_64-apple-darwin |
| 29 | + os: macos-latest |
| 30 | + - target: aarch64-apple-darwin |
| 31 | + os: macos-latest |
| 32 | + - target: x86_64-pc-windows-msvc |
| 33 | + os: windows-latest |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + submodules: recursive |
| 39 | + |
| 40 | + - name: Install Rust |
| 41 | + uses: dtolnay/rust-toolchain@stable |
| 42 | + with: |
| 43 | + targets: ${{ matrix.target }} |
| 44 | + |
| 45 | + - name: Cache Rust |
| 46 | + uses: Swatinem/rust-cache@v2 |
| 47 | + |
| 48 | + - name: Install pnpm |
| 49 | + uses: pnpm/action-setup@v4 |
| 50 | + |
| 51 | + - name: Install Node.js |
| 52 | + uses: actions/setup-node@v4 |
| 53 | + with: |
| 54 | + node-version: 24 |
| 55 | + cache: pnpm |
| 56 | + |
| 57 | + - name: Install dependencies |
| 58 | + run: pnpm install |
| 59 | + |
| 60 | + - name: Build NAPI |
| 61 | + working-directory: napi/angular-compiler |
| 62 | + run: pnpm build -- --target ${{ matrix.target }} |
| 63 | + |
| 64 | + - name: Upload artifact |
| 65 | + uses: actions/upload-artifact@v6 |
| 66 | + with: |
| 67 | + name: bindings-${{ matrix.target }} |
| 68 | + path: napi/angular-compiler/*.node |
| 69 | + if-no-files-found: error |
| 70 | + |
| 71 | + publish: |
| 72 | + name: Publish |
| 73 | + runs-on: ubuntu-latest |
| 74 | + needs: build |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v4 |
| 77 | + |
| 78 | + - name: Install pnpm |
| 79 | + uses: pnpm/action-setup@v4 |
| 80 | + |
| 81 | + - name: Install Node.js |
| 82 | + uses: actions/setup-node@v6 |
| 83 | + with: |
| 84 | + node-version: 24 |
| 85 | + cache: pnpm |
| 86 | + registry-url: https://registry.npmjs.org |
| 87 | + |
| 88 | + - name: Install dependencies |
| 89 | + run: pnpm install |
| 90 | + |
| 91 | + - name: Download artifacts |
| 92 | + uses: actions/download-artifact@v7 |
| 93 | + with: |
| 94 | + path: napi/angular-compiler |
| 95 | + |
| 96 | + - name: Move artifacts |
| 97 | + run: | |
| 98 | + cd napi/angular-compiler |
| 99 | + for dir in bindings-*; do |
| 100 | + mv "$dir"/*.node . || true |
| 101 | + done |
| 102 | + rm -rf bindings-* |
| 103 | +
|
| 104 | + - name: Publish to npm |
| 105 | + working-directory: napi/angular-compiler |
| 106 | + run: npm publish --provenance --access public |
| 107 | + env: |
| 108 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments