Get workflow building dist zip under GH Action #7
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: NodeJS with Webpack | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x, 22.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Build | |
| run: | | |
| npm install | |
| npx run build | |
| # Upload the dist folder as an artifact if needed for subsequent jobs or storage | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-folder | |
| path: dist/ | |
| # create a zip file of the dist folder for easier download | |
| - name: Zip dist folder | |
| run: zip -r typex.zip dist/ | |
| - name: Upload dist.zip as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-zip | |
| path: typex.zip |