-
-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (46 loc) · 1.32 KB
/
dev-publish.yml
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
43
44
45
46
47
48
49
name: Publish Dev Build
on:
workflow_call:
secrets:
NPM_TOKEN:
required: true
TEST_APP_TOKEN:
required: true
workflow_dispatch:
jobs:
lint:
name: ESLint
uses: ./.github/workflows/lint.yml
testing:
name: Feature Testing
uses: ./.github/workflows/feature-testing.yml
secrets: inherit
publish:
runs-on: ubuntu-latest
needs: [lint, testing]
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: npm i
- name: Set Version
run: |
git config user.email "<>"
git config user.name "GitHub Actions"
npm --no-git-tag-version version patch
hash=$(git rev-parse --short dev)
version=$(jq -r .version package.json)
v="$version-dev.$hash"
echo "Setting Version: $v"
contents=$(jq --arg version "$v" '.version = $version' package.json) && echo -E "${contents}" > package.json
- name: Publish
run: npm publish --tag dev --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deprecate Old Versions
run: npx -y npm-deprecate
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}