-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (47 loc) · 1.65 KB
/
jdeploy.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
# This workflow will build a Java project with Maven and bundle them as native app installers with jDeploy
# See https://www.jdeploy.com for more information.
name: build and deploy using jDeploy
on:
push:
branches: ['develop']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 22
uses: actions/setup-java@v3
with:
java-version: '22'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
# deploy to npm:
# - get app version
# - update package.json
# - install and run jdeploy
- name: Fetch Version
run: |
# set DM_VERSION to maven version (timestamp)
echo "DM_VERSION=$(cat target/classes/app.properties | grep version | cut -d= -f2)" >> "$GITHUB_ENV"
- name: Update Version in package.json
run: |
echo "VERSION = ${{ env.DM_VERSION }}"
# update package.json with app version
cat package.json | sed 's/"version": ".*"/"version": "${{ env.DM_VERSION }}"/g' > package.new
cat package.new
mv package.new package.json
- name: set NPM token
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install and run jdeploy
run: |
npm install jdeploy
npx jdeploy publish
- name: "Create Release"
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.DM_VERSION }}
generate_release_notes: true