-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (40 loc) · 1.28 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
name: tests
on:
push:
branches-ignore:
- q/*/*
jobs:
test:
permissions:
packages: write
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
registry-url: https://npm.pkg.github.com
- name: install dependencies
run: yarn install --frozen-lockfile
- name: lint markdown
run: yarn lint_md
- name: lint javascript
run: yarn lint
- name: Set common env vars for npm publish
run: |
echo "SHORTSHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
echo "PKG_VERSION=$(jq -r .version < package.json)" >> $GITHUB_ENV
- name: Set version for work in progress
run: yarn version --no-git-tag-version --new-version "0.0.0-sha.${SHORTSHA}"
if: github.ref_protected == false
- name: Set version for protected branch
run: yarn version --no-git-tag-version --new-version "${PKG_VERSION}-sha.${SHORTSHA}"
if: github.ref_protected
- name: Publish development version
run: npm publish --provenance --tag "${{ github.ref_name }}"
env:
NODE_AUTH_TOKEN: ${{ github.token }}