generated from flowcore-io/nodejs-typescript-transformer-example
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.68 KB
/
build.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
name: Build and Publish Artifact
on:
release:
types: [ published ]
permissions:
id-token: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: version
with:
cmd: 'jq .version package.json -r'
- name: Show my version
run: 'echo "version ${{ steps.version.outputs.value }}"'
- name: Extract package name from package.json
uses: sergeysova/jq-action@v2
id: package
with:
cmd: 'jq .name package.json -r'
- name: Show package name
run: 'echo "version ${{ steps.package.outputs.value }}"'
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "${{ env.NODE_VERSION }}"
cache: yarn
- name: Yarn install
run: |
yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Build Artifact
run: |
yarn build
yarn install --frozen-lockfile --production --modules-folder dist/node_modules
rm dist/package.json
- name: Compress Artifact
run: zip -r ${{ steps.package.outputs.value }}-${{ steps.version.outputs.value }}.zip .
working-directory: dist
- name: Upload artifact and release
uses: nanoufo/action-upload-artifacts-and-release-assets@main
with:
path: |
dist/${{ steps.package.outputs.value }}-${{ steps.version.outputs.value }}.zip
upload-release-files: true
release-upload-url: ${{ github.event.release.upload_url }}