Skip to content

Add release workflow #9

Add release workflow

Add release workflow #9

Workflow file for this run

name: 'Github ehex releases'
on:
push:
branches:
- ehex
jobs:
# New build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Build with Maven
run: mvn clean package -DskipTests
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hpi-file
path: target/*.hpi
# New release job
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: hpi-file
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Find HPI file
id: find_hpi
run: |
hpi_path=$(find . -name "*.hpi" -print -quit)
echo "HPI_PATH=$hpi_path" >> $GITHUB_ENV
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.HPI_PATH }}
asset_name: $(basename ${{ env.HPI_PATH }})
asset_content_type: application/octet-stream