update jdk install #11
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
name: Java CI with Maven | |
on: | |
push: | |
tags: [ "v*" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: clean jdk 11 | |
run: sudo apt remove -y openjdk-11-* | |
- name: install packages | |
run: sudo apt install -y openjdk-8-jdk | |
- uses: hb0730/[email protected] | |
- name: build and package | |
run: mvn clean package -PbuildKar --file pom.xml | |
- name: version | |
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" | tee -a $GITHUB_OUTPUT | |
id: version | |
- name: release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: ${{ github.ref_name }} | |
tag_name: ${{ github.ref }} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: upload kar artifact | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./target/nexus-repository-chef-${{ steps.version.outputs.version }}-bundle.kar | |
asset_name: nexus-repository-chef-${{ steps.version.outputs.version }}-bundle.kar | |
asset_content_type: application/zip |