Skip to content

Commit

Permalink
Add build workflow
Browse files Browse the repository at this point in the history
Signed-off-by: applenick <[email protected]>
  • Loading branch information
applenick committed Mar 19, 2023
1 parent 5132972 commit e5ccd2d
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish compiled jar to GitHub releases
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '8'
- name: Build jar
run: mvn --batch-mode --update-snapshots verify
- name: Move generated jar file
run: mv target/Cheaty-*.jar Cheaty.jar
- name: Create Release
id: create_release
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: Cheaty-${{github.sha}}
release_name: Release ${{github.sha}}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Cheaty.jar
asset_name: Cheaty.jar
asset_content_type: application/java-archive

0 comments on commit e5ccd2d

Please sign in to comment.