utils/.github/workflows/build.yaml

54 lines
1.3 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:
2024-07-19 00:06:17 -04:00
image: node:alpine
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
2024-07-19 00:06:17 -04:00
- name: Install & Build Project
run: |
npm run i
npm run build
2024-02-28 23:57:20 -05:00
2024-02-07 01:33:07 -05:00
- name: Test
run: npm run test:coverage
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}}