-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (51 loc) · 1.34 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 Release
on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build, Test and Release
runs-on: ubuntu-latest
env:
PROJECT_NAME: 'blockcore-hub'
steps:
- uses: actions/checkout@master
name: Checkout
- uses: actions/setup-node@v2
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Variables
run: |
echo VERSION=$(npm run version --silent) >> $GITHUB_ENV
shell: bash
- name: Package Name
run: |
echo RELEASE_NAME=${{ env.PROJECT_NAME }}-${{ env.VERSION }}.tgz >> $GITHUB_ENV
shell: bash
# - name: Install and Build
# run: |
# npm install
# npm run build
# - name: Run Tests
# run: |
# npm run test
- name: Package
run: |
npm pack
- uses: actions/upload-artifact@v1
with:
name: ${{env.PROJECT_NAME}}-preview-${{env.VERSION}}
path: "${{env.RELEASE_NAME}}"
- name: Release
uses: sondreb/action-release@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: "${{env.RELEASE_NAME}}"
draft: true
prerelease: false
name: "Blockcore Hub (${{env.VERSION}})"
tag: ${{env.VERSION}}