-
Notifications
You must be signed in to change notification settings - Fork 3
110 lines (108 loc) · 3 KB
/
ozma-embedded.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: ozma-embedded
on: push
jobs:
build:
name: Build
permissions:
contents: read
id-token: write
attestations: write
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
artifact-url: ${{ steps.upload.outputs.artifact-url }}
bundle-id: ${{ steps.upload-bundle.outputs.artifact-id }}
bundle-url: ${{ steps.upload-bundle.outputs.artifact-url }}
defaults:
run:
working-directory: ./ozma-embedded
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: yarn
cache-dependency-path: ./ozma-embedded/yarn.lock
- name: Install Dependencies
run: |
yarn install --immutable
echo "Dirs:"
ls -lah
echo "All dirs"
- name: Check Formatting
run: |
yarn prettier -c
- name: Lint
run: |
yarn lint --no-fix --max-warnings 0
- name: Build
env:
NODE_ENV: production
run: |
yarn build
- name: Pack
env:
NODE_ENV: production
run: |
yarn pack
- name: Upload Artifacts
id: upload
uses: actions/upload-artifact@v4
with:
name: ozma-embedded
path: ./ozma-embedded/*.tgz
if-no-files-found: error
- name: Upload Bundle
id: upload-bundle
uses: actions/upload-artifact@v4
with:
name: ozma-embedded-bundle
path: ./ozma-embedded/bundle/embedded.min.js
if-no-files-found: error
# - name: Attest
# uses: actions/attest-build-provenance@v1
# with:
# subject-path: out/ozmadb/**
publish-release:
name: Publish Release
if: startsWith(github.ref, 'refs/tags/v')
needs: build
permissions:
contents: write
id-token: write
attestations: write
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ozma-embedded
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
always-auth: true
- name: Download Release
uses: actions/download-artifact@v4
with:
name: ozma-embedded
path: ./ozma-embedded/
- name: Check the version
env:
REF: ${{ github.ref }}
run: |
rel_version=${REF#refs/tags/v}
curr_version=$(jq -r .version package.json)
if [ "$rel_version" != "$curr_version" ]; then
echo "Tag doesn't correspond to the project version. Expected '$rel_version', got '$curr_version'." >&2
exit 1
fi
echo "Publishing version: $rel_version"
- name: Publish to NPM
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn publish --access public *.tgz