-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (90 loc) · 3.21 KB
/
release-and-publish.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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Create release and publish it
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Node for NPMJS Deployment
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: yarn.lock
registry-url: https://registry.npmjs.org/
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
node_modules
packages/addons/node_modules
packages/cli/node_modules
packages/client/node_modules
packages/server/node_modules
packages/shared/node_modules
packages/test/node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install YARN dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Set up JDK for Maven Deployment
uses: actions/setup-java@v3
with:
cache: maven
java-version: "8.0.332+9"
distribution: "temurin"
server-id: ossrh
server-username: MVN_USERNAME
server-password: MVN_PASSWORD
env:
MVN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MVN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Install MAVEN dependencies
run: mvn dependency:resolve -B -U
- name: lint
run: yarn lint
- name: test
run: yarn test:ci
- name: build
run: yarn build
- name: E2E tests
run: yarn test:e2e
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
with:
changelog_file: Release-Notes.md
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v1
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: publish maven packages
run: mvn --batch-mode deploy -Prelease
env:
MVN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MVN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: publish npm packages
run: yarn publish-npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{ steps.extract-release-notes.outputs.release_notes }}
env:
# The workflow permissions of the project must be updated to 'Workflows have read and write permissions in the repository for all scopes'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}