-
Notifications
You must be signed in to change notification settings - Fork 1.2k
170 lines (143 loc) · 4.89 KB
/
publish-latest-elsa.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Build and Publish Elsa Packages
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
release:
types: [published]
env:
NODE_OPTIONS: --max-old-space-size=4096
ELSA_VERSION: 2.14.0
jobs:
build_and_pack:
name: Build and Pack Elsa
runs-on: ubuntu-latest
services:
mongo:
image: mongo
ports:
- 27017:27017
postgres:
image: postgres
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: Password12!
POSTGRES_DB: elsa
ports:
- 5432:5432
steps:
- name: Set preview VERSION variable
run: echo "VERSION=$ELSA_VERSION-preview.${{ github.run_number }}" >> $GITHUB_ENV
if: ${{ github.event_name != 'release' }}
- name: Set release VERSION variable
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
if: ${{ github.event_name == 'release' }}
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: echo $VERSION
- run: node --version
- run: npm --version
- name: Build Designer
working-directory: ./src/designer/elsa-workflows-studio
run: |
npm install --force
npm version $VERSION --allow-same-version
npm run build
- name: Pack Designer
working-directory: ./src/designer/elsa-workflows-studio
run: npm pack
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
- name: Upload Designer Artifact
uses: actions/upload-artifact@v3
with:
name: designer-npm-package
path: src/designer/elsa-workflows-studio/elsa-*.tgz
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
- name: Build Bindings
working-directory: ./src/designer/bindings/aspnet/Elsa.Designer.Components.Web
run: |
npm install --force
npm install -g webpack
npm install -g webpack-cli
npm run build
- name: Build Elsa
run: dotnet build --configuration Release /p:Version=$VERSION
- name: Run Tests
run: dotnet test --configuration Release --no-build --no-restore
- name: Pack Elsa
run: dotnet pack --configuration Release /p:Version=$VERSION /p:PackageOutputPath=$(pwd)/out
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
- name: Upload Elsa Artifact
uses: actions/upload-artifact@v3
with:
name: elsa-nuget-package
path: out/*nupkg
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
publish_npm_preview:
name: Publish npm (Preview)
needs: build_and_pack
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
steps:
- name: Download NPM Package
uses: actions/download-artifact@v3
with:
name: designer-npm-package
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
registry-url: 'https://f.feedz.io/elsa-workflows/elsa-2/npm/'
- run: npm publish *.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.FEEDZ_IO_NPM }}
publish_npm_release:
name: Publish to npm
needs: build_and_pack
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
steps:
- name: Download NPM Package
uses: actions/download-artifact@v3
with:
name: designer-npm-package
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
registry-url: 'https://registry.npmjs.org'
- run: npm publish *.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish_nuget_preview:
name: Publish Nuget (Preview)
needs: build_and_pack
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
steps:
- name: Download Nuget Packages
uses: actions/download-artifact@v3
with:
name: elsa-nuget-package
- name: Publish Nuget Packages to MyGet
run: dotnet nuget push *.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s https://f.feedz.io/elsa-workflows/elsa-2/nuget/index.json --skip-duplicate
publish_nuget_release:
name: Publish to Nuget
needs: build_and_pack
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
steps:
- name: Download Nuget Packages
uses: actions/download-artifact@v3
with:
name: elsa-nuget-package
- name: Publish Nuget Packages to MyGet
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate