Skip to content

Commit

Permalink
Update build.yml (#61)
Browse files Browse the repository at this point in the history
Signed-off-by: Alpha <[email protected]>
  • Loading branch information
AlphaKR93 authored Dec 30, 2023
1 parent 74ac208 commit 8c5f28b
Showing 1 changed file with 34 additions and 18 deletions.
52 changes: 34 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
release:
strategy:
matrix:
base_jdk: [21]
graal: [latest]
base_jdk: [17]
os: [ubuntu-22.04]

if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
Expand All @@ -27,21 +26,22 @@ jobs:

- name: Checkout javadocs
uses: actions/checkout@v4
if: github.ref_name == env.MAIN_BRANCH
with:
repository: PlazmaMC/Javadocs
path: javadoc
ref: main
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Set up GraalVM ${{ matrix.base_jdk }}
uses: graalvm/setup-graalvm@v1
with:
github-token: ${{ secrets.GH_PAT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: ${{ matrix.base_jdk }}
version: ${{ matrix.graal }}
version: latest
cache: 'gradle'

- name: Configure Git
Expand Down Expand Up @@ -72,11 +72,11 @@ jobs:
if: github.ref_name == env.MAIN_BRANCH
run: |
export GITHUB_USERNAME=${{ env.ORG_NAME }}
export GITHUB_TOKEN=${{ secrets.GH_PAT }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew publish --stacktrace
- name: Upload Artifacts
if: env.DEBUG == 'true' || !startsWith(github.ref_name, 'ver/')
if: "!startsWith(github.ref_name, 'ver/')"
uses: actions/upload-artifact@v3
with:
name: Artifacts
Expand All @@ -85,24 +85,40 @@ jobs:
Plazma-API/build/docs/javadoc
- name: Get Release Number
run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV
if: startsWith(github.ref_name, 'ver/')
run: echo "RELEASE=$(git ls-remote --tags origin | grep "build/${{ env.MC_VERSION }}" | wc -l)" >> $GITHUB_ENV

- name: Release Artifacts
if: startsWith(github.ref_name, 'ver/')
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-[email protected]
with:
title: "Release #${{ env.RELEASE }}"
automatic_release_tag: release-${{ env.RELEASE }}
repo_token: "${{ secrets.GH_PAT }}"
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/${{ env.RELEASE }}
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
prerelease: false

- name: Release Artifacts (Latest)
- name: Release Artifacts (Latest/Stable)
if: startsWith(github.ref_name, 'ver/')
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-[email protected]
with:
title: "Release #${{ env.RELEASE }}"
automatic_release_tag: latest-${{ env.MC_VERSION }}
repo_token: "${{ secrets.GH_PAT }}"
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar

- name: Release Artifacts (Latest/Development)
if: startsWith(github.ref_name, 'dev/')
uses: softprops/[email protected]
with:
name: "Development Build for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar

prerelease: false

0 comments on commit 8c5f28b

Please sign in to comment.