-
Notifications
You must be signed in to change notification settings - Fork 61
127 lines (114 loc) · 4.38 KB
/
packages.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
name: Elsa Studio 3 Packages
on:
workflow_dispatch:
push:
branches:
- main
release:
types: [ prereleased ]
env:
nuget_feed_feedzio: 'https://f.feedz.io/elsa-workflows/elsa-3/nuget/index.json'
nuget_feed_nuget: 'https://api.nuget.org/v3/index.json'
npm_feed_feedzio: 'https://f.feedz.io/elsa-workflows/elsa-3/npm/'
npm_feed_nuget: 'https://registry.npmjs.org/'
jobs:
build_nuget_packages:
name: Build packages
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Set VERSION variable
run: echo "VERSION=3.0.0-preview.${{github.run_number}}" >> $GITHUB_ENV
- name: Build designer client assets
working-directory: ./src/modules/Elsa.Studio.Workflows.Designer/ClientLib
run: |
npm install --force
npm run build
- name: Build
run: dotnet build Elsa.Studio.sln --configuration Release /p:Version=${VERSION}
- name: Test
run: dotnet test Elsa.Studio.sln --configuration Release /p:Version=${VERSION} --no-build
- name: Pack
run: dotnet pack Elsa.Studio.sln --configuration Release /p:Version=${VERSION} /p:PackageOutputPath=$(pwd)/packages
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: elsa-studio-nuget-packages
path: packages/*nupkg
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
build_npm_packages:
name: Build npm packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish CustomElements
run: |
echo "VERSION=${VERSION}"
dotnet publish ./src/hosts/Elsa.Studio.Host.CustomElements --configuration Release -o ./wasm/ /p:Version=${VERSION}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.12.1
- name: Prepare npm package
run: |
cp ./src/hosts/Elsa.Studio.Host.CustomElements/wasm/npm/package.json ./wasm/wwwroot/package.json
cd ./src/hosts/Elsa.Studio.Host.CustomElements/wasm/wwwroot
npm pack
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: elsa-studio-npm-packages
path: ./src/hosts/Elsa.Studio.Host.CustomElements/wasm/wwwroot/elsa-workflows-elsa-studio-wasm-*.tgz
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
publish_npm_preview_feedzio:
name: Publish npm packages to feedz.io
needs: build_npm_packages
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
steps:
- name: Download Packages
uses: actions/download-artifact@v3
with:
name: elsa-studio-npm-packages
path: elsa-studio-npm-packages
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
registry-url: '${{ env.npm_feed_feedzio }}'
- run: npm publish ./elsa-studio-npm-packages/*.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.FEEDZ_API_KEY }}
publish_nuget_preview_feedzio:
name: Publish nuget packages to feedz.io
needs: build_nuget_packages
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
steps:
- name: Download Packages
uses: actions/download-artifact@v3
with:
name: elsa-studio-nuget-packages
- name: Publish to feedz.io
run: dotnet nuget push *.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s ${{ env.feedz_feed_source }} --skip-duplicate
publish_nuget_preview_nuget:
name: Publish to nuget.org
needs: build_nuget_packages
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ github.event_name == 'release' || github.event_name == 'prereleased' }}
steps:
- name: Download Packages
uses: actions/download-artifact@v3
with:
name: elsa-studio-nuget-packages
- name: Publish to nuget.org
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.nuget_feed_nuget }} --skip-duplicate