Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzeblocks authored Aug 7, 2024
1 parent 8d859ee commit 4728232
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,30 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

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

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

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

- name: Extract JAR version
id: extract_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 }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release v${{ github.run_number }}
Expand All @@ -43,6 +49,8 @@ jobs:
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/TaskApp-1.0-SNAPSHOT.jar
asset_path: target/TaskApp-${{ env.VERSION }}.jar
asset_name: TaskApp-${{ github.run_number }}.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

0 comments on commit 4728232

Please sign in to comment.