Minor workflow fixes #21
This file contains 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 | |
on: | |
# Triggers the workflow on pull request | |
pull_request: | |
# Allows to trigger workflow manually | |
workflow_dispatch: | |
# Allows to call this workflow from another workflow | |
workflow_call: | |
inputs: | |
should_pack: | |
type: boolean | |
default: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
run : npm ci --ignore-scripts | |
- name: Lint | |
run: npm run lint | |
- name: Test | |
run: npm run test | |
- name: Build | |
run: npm run build | |
- name: Pack build reults | |
if: ${{ inputs.should_pack == true }} | |
run: npm pack | |
- name: Get version | |
id: get_version | |
if: ${{ inputs.should_pack == true }} | |
run: | | |
VERSION=$(node -pe 'require("./package.json").version') | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Upload build result | |
if: ${{ inputs.should_pack == true }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ukorvl-react-on-screen-${{ steps.get_version.outputs.version }} | |
path: ukorvl-react-on-screen-${{ steps.get_version.outputs.version }}.tgz | |
if-no-files-found: error | |
retention-days: 1 |