diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee317272..93e435e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,26 +48,6 @@ jobs: name: example-app path: example-app/target/*.jar - - name: Upload db-scheduler-ui packages - uses: actions/upload-artifact@v3 - with: - name: db-scheduler-ui - path: '**/target/*.jar' - - publish: - name: Publish packages - runs-on: ubuntu-latest - needs: build - - steps: - - name: download packages artifact - uses: actions/download-artifact@v3 - with: - name: db-scheduler-ui - - - name: show files - run: ls -a - deploy: if: github.ref == 'refs/heads/main' name: Deploy to Heroku @@ -80,7 +60,7 @@ jobs: - name: Download production-ready build files uses: actions/download-artifact@v3 with: - name: production-files + name: example-app - name: Deploy to Heroku uses: akhileshns/heroku-deploy@v3.12.14 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..6310f557 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release + +on: + release: + types: + - published + +jobs: + release: + name: Build and release packages + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + + - name: Install dependencies + run: npm install + working-directory: db-scheduler-ui-frontend + + - name: Build frontend + run: npm run build + working-directory: db-scheduler-ui-frontend + + - name: Create static folder in backend + run: mkdir -p db-scheduler-ui/src/main/resources/static + + - name: Copy static frontend to java package + run: cp -r db-scheduler-ui-frontend/dist/. db-scheduler-ui/src/main/resources/static/ + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: remove v in tag + run: | + TAG=${{ github.event.release.tag_name }} + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + + - name: Set release version + run: | + TAG=${{ github.event.release.tag_name }} + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + mvn --no-transfer-progress --batch-mode versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false + + - name: Stage release + run: mvn --batch-mode clean deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/db-scheduler-ui-frontend/package-lock.json b/db-scheduler-ui-frontend/package-lock.json index 2af5d6ff..60cd0890 100644 --- a/db-scheduler-ui-frontend/package-lock.json +++ b/db-scheduler-ui-frontend/package-lock.json @@ -26,7 +26,6 @@ "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "@vitejs/plugin-react": "^4.0.3", - "cross-env": "^7.0.3", "eslint": "^8.47.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-vite": "^1.3.0", @@ -3076,24 +3075,6 @@ "node": ">=10" } }, - "node_modules/cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "bin": { - "cross-env": "src/bin/cross-env.js", - "cross-env-shell": "src/bin/cross-env-shell.js" - }, - "engines": { - "node": ">=10.14", - "npm": ">=6", - "yarn": ">=1" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/db-scheduler-ui-starter/pom.xml b/db-scheduler-ui-starter/pom.xml index 69867dfd..63323ca4 100644 --- a/db-scheduler-ui-starter/pom.xml +++ b/db-scheduler-ui-starter/pom.xml @@ -6,7 +6,7 @@ com.github.bekk db-scheduler-ui-parent - 0.0.1-snapshot + main-SNAPSHOT db-scheduler-ui-starter @@ -26,6 +26,14 @@ + + + github + GitHub Packages + https://maven.pkg.github.com/bekk/db-scheduler-ui + + + org.springframework.boot @@ -44,7 +52,7 @@ com.github.bekk db-scheduler-ui - 0.0.1-snapshot + ${project.version} diff --git a/db-scheduler-ui/pom.xml b/db-scheduler-ui/pom.xml index 82c52e46..7f4b585d 100644 --- a/db-scheduler-ui/pom.xml +++ b/db-scheduler-ui/pom.xml @@ -6,7 +6,7 @@ com.github.bekk db-scheduler-ui-parent - 0.0.1-snapshot + main-SNAPSHOT db-scheduler-ui diff --git a/example-app/pom.xml b/example-app/pom.xml index ecaf1c7e..48622bff 100644 --- a/example-app/pom.xml +++ b/example-app/pom.xml @@ -6,14 +6,17 @@ com.github.bekk db-scheduler-ui-parent - 0.0.1-snapshot + main-SNAPSHOT - example-app example-app Example app using db-scheduler-ui + + true + + @@ -55,7 +58,7 @@ com.github.bekk db-scheduler-ui-starter - 0.0.1-snapshot + main-SNAPSHOT org.springframework.boot @@ -69,6 +72,7 @@ org.springframework.boot spring-boot-maven-plugin + 3.1.2 com.github.bekk.exampleapp.ExampleApp JAR diff --git a/pom.xml b/pom.xml index 9561954a..8b44b4c4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.github.bekk db-scheduler-ui-parent - 0.0.1-snapshot + main-SNAPSHOT pom db-scheduler-ui: Parent Provides a UI for db-scheduler @@ -20,4 +20,12 @@ db-scheduler-ui-starter example-app + + + + github + GitHub Packages + https://maven.pkg.github.com/bekk/db-scheduler-ui + +