utils/.github/workflows/build.yaml

66 lines
1.6 KiB
YAML
Raw Normal View History

2024-02-07 01:33:07 -05:00
name: Build
run-name: Build
on:
- push
- pull_request
jobs:
build:
name: Build NPM Project
runs-on: ubuntu-latest
container:
image: node
2024-04-14 08:01:17 -04:00
volumes:
- '/mnt/swarm/gitea/runner/cache:/cache'
2024-02-07 01:33:07 -05:00
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
- name: Restore node_modules
uses: ztimson/actions/cache/restore@develop
with:
key: node_modules
- name: Install Dependencies
run: npm i
2024-02-28 23:57:20 -05:00
- name: Build Project
run: npm run build
2024-02-07 01:33:07 -05:00
- name: Test
run: npm run test:coverage
- name: Cache node_modules
uses: ztimson/actions/cache@develop
with:
key: node_modules
pattern: node_modules
2024-06-16 08:36:45 -04:00
- name: Upload to Registry
uses: ztimson/actions/npm/publish@develop
- name: Upload to NPM
uses: ztimson/actions/npm/publish@develop
2024-02-07 01:33:07 -05:00
with:
2024-06-16 08:36:45 -04:00
owner: ztimson
registry: https://registry.npmjs.org/
token: ${{secrets.NPM_TOKEN}}
2024-02-07 01:33:07 -05:00
tag:
name: Tag Version
needs: build
if: ${{github.ref_name}} == 'release'
runs-on: ubuntu-latest
container: node
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
- name: Get Version Number
run: echo "VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
- name: Tag Version
uses: ztimson/actions/tag@develop
with:
tag: ${{env.VERSION}}