Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3-M4513R authored Nov 22, 2023
1 parent 1f62e21 commit d26b1c6
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: Server builds
on:
push:
branches: [master]

pull_request:
branches:
- '*'
permissions:
contents: write #nessesary for tag creation and release creation

jobs:
build:
Expand Down Expand Up @@ -32,11 +36,14 @@ jobs:
name: Magma
path: projects/magma/build/libs/magma**.jar

- name: Upload artifacts to the api
env:
ID: ${{ secrets.ID }}
- name: Create Release
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
run: |
cd projects/magma/build/libs/
jar_file=$(ls magma*.jar | head -n 1)
chmod +r $jar_file
curl -X POST -F "file=@$jar_file" http://64.58.124.27:25565/1.18.2/upload/$ID
tag=$(git rev-parse --short ${{ github.sha }})
gh release create "$tag" projects/magma/build/libs/magma**.jar \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--prerelease \
--generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d26b1c6

Please sign in to comment.