Skip to content

Merge pull request #35 from jpage4500/feature/02-05 #36

Merge pull request #35 from jpage4500/feature/02-05

Merge pull request #35 from jpage4500/feature/02-05 #36

Workflow file for this run

# 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
# create github release - https://github.com/jpage4500/AndroidDeviceManager/releases
- 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
files: |
target/AndroidDeviceManager.jar