update staging directory #180
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: Build node-fibers with prebuilt Node | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - v22.21.1 | |
| jobs: | |
| build-fibers: | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: linux | |
| arch: x64 | |
| runs_on: ubuntu-22.04 | |
| - platform: linux | |
| arch: arm64 | |
| runs_on: ubuntu-22.04-arm | |
| runs-on: ${{ matrix.runs_on }} | |
| env: | |
| NODE_VERSION: v22.21.1 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Debug Matrix Values | |
| run: | | |
| echo "Matrix platform: ${{ matrix.platform }}" | |
| echo "Matrix arch: ${{ matrix.arch }}" | |
| - name: Download Node archive | |
| run: | | |
| gh release download node-${{ env.NODE_VERSION }}-release \ | |
| --repo asana/node \ | |
| --pattern "node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz" | |
| mv node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz node.tar.xz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Execute the Dockerfile | |
| run: | | |
| pwd | |
| docker build -t node22_fibers_build -f Dockerfile.Fibers . | |
| - name: Extract resources | |
| run: | | |
| docker create --name temp_node_fibers_extract node22_fibers_build | |
| docker cp temp_node_fibers_extract:/usr/src/node/node-fibers $GITHUB_WORKSPACE/node-fibers | |
| docker rm temp_node_fibers_extract | |
| - name: Find and archive fibers.node | |
| run: | | |
| # Find the directory under bin/ that contains fibers.node | |
| FIBERS_PATH=$(find ./node-fibers/bin -type f -name fibers.node | head -n1) | |
| FIBERS_DIR=$(dirname "$FIBERS_PATH") | |
| ARCHIVE_NAME=$(basename "$FIBERS_DIR").tar.gz | |
| echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_ENV | |
| tar -czf "$ARCHIVE_NAME" -C "$(dirname "$FIBERS_DIR")" "$(basename "$FIBERS_DIR")" | |
| - name: Upload archive to release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: node-${{ env.NODE_VERSION }}-LATEST | |
| tag_name: node-${{ env.NODE_VERSION }}-release | |
| files: ${{ env.ARCHIVE_NAME }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |