more if else logic #6
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*" | |
| jobs: | |
| release: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| arch: x64 | |
| suffix: linux-amd64 | |
| - os: ubuntu-latest | |
| arch: arm64 | |
| suffix: linux-arm64 | |
| name: "Release for ${{ matrix.suffix }}" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v4 | |
| # ARM64 build in Docker | |
| - name: Build in ARM64 Docker container | |
| if: matrix.arch == 'arm64' | |
| run: | | |
| docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace node:18-bullseye bash -c " | |
| npm ci && | |
| npm run build && | |
| npm pack | |
| " | |
| # x64 steps only | |
| - name: Setup Node.js | |
| if: matrix.arch == 'x64' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| architecture: ${{ matrix.arch }} | |
| - name: Install dependencies | |
| if: matrix.arch == 'x64' | |
| run: npm ci | |
| - name: Build application | |
| if: matrix.arch == 'x64' | |
| run: npm run build | |
| - name: Package application | |
| if: matrix.arch == 'x64' | |
| run: npm pack | |
| - name: Create release | |
| uses: marvinpinto/action-automatic-releases@latest | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| prerelease: false | |
| files: | | |
| *.tgz |