-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (104 loc) · 3.74 KB
/
automatic-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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: auto test npm-publish and release draft
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: ['16.x', '18.x']
# When set to true, GitHub cancels all in-progress jobs if any matrix job fails.
fail-fast: false
# The maximum number of jobs that can run simultaneously. Set to 1 if you can't run tests in parallel
# max-parallel: 1
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
- name: Install root dependecies
run: npm ci
- name: Lerna bootstrap (install packages dependecies)
run: npx lerna bootstrap
- name: Run tests
run: npm test
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
npm-publish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: NPM publish
run: ./scripts/libraries.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
docker:
needs: npm-publish
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Login to GitLab docker registry
uses: docker/login-action@v2
with:
registry: 'registry.gitlab.com'
username: ${{ secrets.GITLAB_REGISTRY_USER }}
password: ${{ secrets.GITLAB_REGISTRY_TOKEN }}
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
with:
path: packages/cloud-vault-server
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./packages/cloud-vault-server/docker
push: true
build-args: VERSION=${{ steps.package-version.outputs.current-version}}
tags: registry.gitlab.com/i3-market/code/wp3/t3.2/i3m-wallet-monorepo/cvs:${{ steps.package-version.outputs.current-version}},registry.gitlab.com/i3-market/code/wp3/t3.2/i3m-wallet-monorepo/cvs:latest
- name: Ansible deploy
run: |
curl --request POST --header "Authorization: Bearer ${{ secrets.ANSIBLE_DEPLOY_TOKEN }}" "${{ secrets.ANSIBLE_DEPLOY_URL }}"
pack:
name: pack and generate release draft
needs: npm-publish
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-11]
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install root dependencies
run: npm ci
- name: Install desktop dependencies
run: npm run install:desktop
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# Directory where NPM/Yarn commands should be run
package_root: './packages/wallet-desktop'
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}