generated from Blackprint/template-js
-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (54 loc) · 1.9 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
dryRun:
description: 'View list of files that will be published before the real release'
required: true
default: 'true' ## Dry run
# release:
# This specifies that the build will be triggered when we publish a release
# types: [published]
jobs:
build:
name: Build and release module
runs-on: ubuntu-latest
timeout-minutes: 6 # Usually this will be finish under 6 minutes
steps:
- uses: actions/checkout@v4
- name: ⚙ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: 🔃 Setup PNPM modules
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2
with:
version: 6.0.2
run_install: true
- name: 🛠 Compiling Blackprint Modules
run: npx blackprint build production
- run: npm version ${{ github.event.release.tag_name }}
- name: 🔥 Run Tests
env:
MNEMONIC_A: ${{ secrets.MNEMONIC_A }}
MNEMONIC_B: ${{ secrets.MNEMONIC_B }}
WALLET_ADDRESS_A: ${{ secrets.WALLET_ADDRESS_A }}
WALLET_ADDRESS_B: ${{ secrets.WALLET_ADDRESS_B }}
IS_PR: ${{ github.event.inputs.dryRun == 'true' }} # Skip transaction test
run: npm test
- name: 📦 Dry Run
if: github.event.inputs.dryRun == 'true'
run: npm publish --dry-run
# If you want to publish to NPM, make sure to put your NPM token to repository settings
- name: 📦 Publish Packages
if: github.event.inputs.dryRun != 'true'
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}