This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
Merge pull request #4 from C0D3-M4513R/patch-1 #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Server builds | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: | |
- '*' | |
permissions: | |
contents: write #nessesary for tag creation and release creation | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup java 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
- name: Setup gradle | |
run: chmod +x ./gradlew | |
- name: Setup | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: setup | |
- name: Build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: outputJar | |
- name: Upload artifacts | |
uses: actions/[email protected] | |
with: | |
name: Magma | |
path: projects/forge/build/libs/Magma**.jar | |
- name: Create Release | |
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} | |
run: | | |
tag=$(git rev-parse --short ${{ github.sha }}) | |
gh release create "$tag" projects/forge/build/libs/Magma**.jar \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \ | |
--generate-notes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |