Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Close #7 Group system (#8) #13

Close #7 Group system (#8)

Close #7 Group system (#8) #13

Workflow file for this run

name: Build and Release
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BUILD_NUMBER: ${{ github.run_number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: oracle
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Build with Maven
run: mvn clean package
- name: Retrieve Project Name & Version
id: project-info
run: |
echo "projectName=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.name}' --non-recursive exec:exec)" >> $GITHUB_ENV
echo "projectVersion=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: build-${{ github.run_number }}
release_name: Release ${{ env.projectVersion }} build-${{ github.run_number }}
body: ${{ join(github.event.commits.*.message, ' || ') }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/${{ env.projectName }}-${{ env.projectVersion }}.jar
asset_name: ${{ env.projectName }}-${{ env.projectVersion }}.jar
asset_content_type: application/java-archive