Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tumbl3w33d committed Jan 30, 2024
1 parent 11f77a7 commit c716164
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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

0 comments on commit c716164

Please sign in to comment.