Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Workflow (1.19.4) #62

Merged
merged 1 commit into from
Dec 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 38 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,32 @@ jobs:
strategy:
matrix:
base_jdk: [17]
graal: [latest]
os: [ubuntu-22.04]

if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout action
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout pages
uses: actions/checkout@v3
- name: Checkout javadocs
uses: actions/checkout@v4
if: github.ref_name == env.MAIN_BRANCH
with:
repository: PlazmaMC/Javadocs
path: javadoc
ref: gh-pages
token: ${{ secrets.GH_PAT }}
ref: main
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 @@ -71,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 @@ -84,24 +85,38 @@ 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/[email protected]
with:
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:
title: "Release #${{ env.RELEASE }}"
automatic_release_tag: latest-${{ env.MC_VERSION }}
repo_token: "${{ secrets.GH_PAT }}"
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