-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (56 loc) · 1.94 KB
/
release-snapshot.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
name: Release a snapshot
on:
# Only manual workflow trigger
workflow_dispatch:
inputs:
colonyNetworkHead:
description: 'colonyNetwork tag, branch or hash'
required: false
default: 'develop'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
- uses: pnpm/action-setup@v3
with:
version: 8.15.6
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Cache NPM dependencies
uses: actions/cache@v4
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
- name: Checkout the desired colonyNetwork tag or branch
working-directory: ./vendor/colonyNetwork
run: git fetch && git checkout ${{ github.event.inputs.colonyNetworkHead }}
- name: Install dependencies for colonyNetwork
working-directory: ./vendor/colonyNetwork
run: npm ci
- name: Compile colonyNetwork contracts
working-directory: ./vendor/colonyNetwork
run: npx hardhat compile
- run: pnpm run build
- run: pnpm test
- run: ls dist/versions/${{ github.event.inputs.colonyNetworkHead }} || ls dist/versions/next
- name: Generate version hash
id: version_hash
run: echo "VERSION_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Publish package
run: |
npm version 0.0.0-snapshot-${{ env.VERSION_HASH }} --no-git-tag-version
npm publish --access public --tag snapshot
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}