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

Github Actions

Github Actions #113

Workflow file for this run

name: Publish Development Build
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: 17
distribution: adopt
- name: Build
run: ./gradlew build -Pgithub_sha=${{ github.sha }}
- name: VirusTotal
id: virustotal_step
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
request_rate: 4
files: |
./build/libs/*.jar
- name: Pretty Result
id: pretty_result
run: |
echo "virus_total_link=$(echo ${{ steps.virustotal_step.outputs.analysis }} | cut -d ',' -f 1 | cut -d 'jar=' -f 2)" >> $GITHUB_OUTPUT
echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
echo "file=$(ls build/libs/*.jar | head -n 1)" >> $GITHUB_OUTPUT
echo "file_name=$(ls build/libs/*.jar | head -n 1 | xargs -n 1 basename)" >> $GITHUB_OUTPUT
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configurationJson: |
{
"categories": [
{
"title": "## Changes",
"labels": [],
"exhaustive": false
}
],
"template": "#{{CHANGELOG}}\nVirusTotal Analysis: ${{steps.pretty_result.outputs.virus_total_link}}",
}
- name: Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.pretty_result.outputs.short_sha }}
prerelease: true
release_name: Dev Build ${{ steps.pretty_result.outputs.short_sha }}
draft: false
body: |
${{ steps.github_release.outputs.changelog }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_path: ${{ steps.pretty_result.outputs.file }}
asset_content_type: application/java-archive
upload_url: ${{ steps.release.outputs.upload_url }}
asset_name: ${{ steps.pretty_result.outputs.file_name }}