Skip to content

Commit

Permalink
Add dependency in the jar
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzeblocks committed Aug 7, 2024
2 parents 8e55317 + 2a9499f commit bf0dd29
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Java CI with Maven

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: List files in target directory
run: ls -l target

- name: Get project version
id: get_version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release v${{ github.run_number }}
body: Automatically created release

- name: Upload JAR to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/TaskApp-${{ env.VERSION }}.jar
asset_name: TaskApp-${{ github.run_number }}.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bf0dd29

Please sign in to comment.