Skip to content

Update main.yml

Update main.yml #65

Workflow file for this run

name: Codeanalyzer CI
on:
push:
branches:
- GA
permissions:
contents: write
jobs:
build-and-package:
runs-on: ubuntu-latest
env:
JAVA_HOME: ${{ github.workspace }}/graalvm-ce-java11-22.3.3
steps:
- name: Check out code
uses: actions/checkout@v4
with:
persist-credentials: true
- name: Set up JDK 11 from GraalVM
run: |
echo "${{ env.JAVA_HOME }}/bin" >> $GITHUB_PATH
wget https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.3/graalvm-ce-java11-linux-amd64-22.3.3.tar.gz
tar -xvzf graalvm-ce-java11-linux-amd64-22.3.3.tar.gz
${{ env.JAVA_HOME }}/bin/gu install native-image
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew clean fatJar
- name: Determine new tag
id: newtag
run: |
VERSION=$(java -jar build/libs/*.jar --version | awk '{print $1}')
TAG="v$VERSION"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Create Git Tag
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git tag ${{ steps.newtag.outputs.tag }}
git push origin ${{ steps.newtag.outputs.tag }}
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
files: build/libs/*.jar
tag_name: ${{ steps.newtag.outputs.tag }}
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}