-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (86 loc) · 3.24 KB
/
build.yaml
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
name: Build
on:
pull_request:
branches:
- dev
workflow_call:
inputs:
branch:
description: 'The current branch'
default: dev
type: string
required: false
debug:
type: boolean
description: enable debug
default: false
env:
BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'dev' }}
enabledebug: ${{ inputs.debug == true && '-vvv' || ''}}
NEXUS_URL: https://packages.nuxeo.com/repository/npm-public/
NEXUS_REPOSITORY: npm-public
NODE_AUTH_TOKEN: ${{ secrets.NPM_ADMIN_TOKEN }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN}}
NEW_VERSION: "2.0.0"
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: ${{ env.NEXUS_URL }}
scope: '@nuxeo'
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: 'Update settings.xml with server configuration'
run: |
echo '<settings>
<servers>
<server>
<id>maven-internal</id>
<username>${{ secrets.PACKAGES_AUTH_USER }}</username>
<password>${{ secrets.PACKAGES_AUTH_TOKEN }}</password>
</server>
</servers>
</settings>' > ~/.m2/settings.xml
- name: Configure Additional Registries
working-directory: nuxeo-admin-console-web/ang-src
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GIT_TOKEN }}" >> .npmrc
# - name: Install Angular CLI
# run: npm install -g @angular/cli
- name: Get Current Realease Vesrion
run: |
echo "CURRENT_VERSION=$(npx -c 'echo \"$npm_package_version\"')" >> $GITHUB_ENV
- name: Update Realease Version Markeplace package
run: |
CURRENT_VERSION=$CURRENT_VERSION
find . -type f -not -path "./node_modules/*" -regex ".*\.\(sample\|xml\)" -exec sed -i 's/'"1.0.0"'/'"$NEW_VERSION"'/g' {} \;
echo "current verion: $CURRENT_VERSION , new version: $NEW_VERSION"
cat pom.xml
- name: Update Realease Version Npm package
working-directory: nuxeo-admin-console-web/ang-src
run: |
npm version $NEW_VERSION
cat package.json
# - name: Build Angular Project
# run: mvn package
# - name: Publish on packages.nuxeo.com
# working-directory: nuxeo-admin-console-web/ang-src
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: |
# npm publish --registry https://packages.nuxeo.com/repository/npm-public/
# - name: Push promoted Admin Console to Connect PREPROD
# working-directory: nuxeo-admin-console-package/target
# env:
# CONNECT_PREPROD_URL: https://nos-preprod-connect.nuxeocloud.com/nuxeo
# run: curl -i -u "${{ secrets.CONNECT_PREPROD_AUTH }}" -F package=@nuxeo-admin-console-package-$NEW_VERSION-SNAPSHOT.zip "$CONNECT_PREPROD_URL/site/marketplace/upload?batch=true"