- WIP - github actions #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
- 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 jdeploy | |
run: | | |
npm install jdeploy | |
jdeploy publish | |
# - name: Build App Installer Bundles | |
# uses: shannah/jdeploy@master | |
# with: | |
# github_token: ${{ github.token }} | |
# deploy_target: npm | |
# npm_token: ${{ secrets.NPM_TOKEN }} |