Skip to content

Commit

Permalink
Merge pull request #1 from 17TheWord/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
17TheWord authored Aug 19, 2024
2 parents 4237659 + 708256f commit 17a9c76
Show file tree
Hide file tree
Showing 143 changed files with 1,579 additions and 919 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: ["https://afdian.com/a/17TheWord"]
46 changes: 5 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build Plugin and Mod

on:
push:
branches:
- main
workflow_dispatch:

permissions:
Expand All @@ -10,45 +13,6 @@ env:
GH_TOKEN: ${{ github.token }}

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read version.txt and save to variable
shell: pwsh
run: |
$mod_version = Get-Content version.txt
Write-Host "Version: $mod_version"
echo "MOD_VERSION=$mod_version" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_ENV
- name: Check if Release exists
id: check-release
run: |
# Check if the release exists
RESPONSE=$(gh release view v${{ env.MOD_VERSION }} -R ${{ github.repository }} 2>&1 || true)
if echo "$RESPONSE" | grep -q "Not Found"; then
echo "Release v${{ env.MOD_VERSION }} does not exist. Skipping deletion."
echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
else
echo "Release v${{ env.MOD_VERSION }} exists."
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
fi
- name: Delete Release if exists
if: env.RELEASE_EXISTS == 'true'
run: |
# Try to delete the release and handle errors gracefully
set +e
gh release delete v${{ env.MOD_VERSION }} -R ${{ github.repository }} -y --cleanup-tag
if [ $? -eq 0 ]; then
echo "Release v${{ env.MOD_VERSION }} deleted successfully."
else
echo "Failed to delete release v${{ env.MOD_VERSION }}. It might not exist or there might be another issue."
fi
- name: Create Release with temp note
run: gh release create v${{ env.MOD_VERSION }} --generate-notes

generate-matrix:
runs-on: windows-latest
outputs:
Expand All @@ -59,12 +23,11 @@ jobs:
id: set-matrix
shell: pwsh
run: |
.\matrix.ps1 -path "fabric","forge","spigot"
.\matrix.ps1 -path "fabric","forge","spigot","velocity"
build:
runs-on: windows-latest
needs:
- create-release
- generate-matrix
strategy:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
Expand Down Expand Up @@ -103,5 +66,6 @@ jobs:
path: QueQiao-jar/${{ env.MOD_VERSION }}/QueQiao-${{ matrix.config.mc-loader }}+${{ matrix.config.mc-version }}-${{ env.MOD_VERSION }}.jar

- name: Upload to Release
if: ${{ github.event_name == 'push' }}
run: |
gh release upload v${{ env.MOD_VERSION }} QueQiao-jar/${{ env.MOD_VERSION }}/QueQiao-${{ matrix.config.mc-loader }}+${{ matrix.config.mc-version }}-${{ env.MOD_VERSION }}.jar
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create Release

on:
push:
branches:
- main

permissions:
contents: write

env:
GH_TOKEN: ${{ github.token }}

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read version.txt and save to variable
shell: pwsh
run: |
$mod_version = Get-Content version.txt
Write-Host "Version: $mod_version"
echo "MOD_VERSION=$mod_version" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_ENV
- name: Check if Release exists
id: check-release
run: |
# Check if the release exists
RESPONSE=$(gh release view v${{ env.MOD_VERSION }} -R ${{ github.repository }} 2>&1 || true)
if echo "$RESPONSE" | grep -q "Not Found"; then
echo "Release v${{ env.MOD_VERSION }} does not exist. Skipping deletion."
echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
else
echo "Release v${{ env.MOD_VERSION }} exists."
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
fi
- name: Delete Release if exists
run: |
# Try to delete the release and handle errors gracefully
set +e
gh release delete v${{ env.MOD_VERSION }} -R ${{ github.repository }} -y --cleanup-tag
if [ $? -eq 0 ]; then
echo "Release v${{ env.MOD_VERSION }} deleted successfully."
else
echo "Failed to delete release v${{ env.MOD_VERSION }}. It might not exist or there might be another issue."
fi
- name: Create Release with temp note
run: gh release create v${{ env.MOD_VERSION }} --generate-notes
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ velocity/velocity-*/
!velocity/velocity-*/gradlew
!velocity/velocity-*/gradlew.bat

!velocity/velocity-*/build/generated/sources/tamplates/

!tool/

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
Expand Down
1 change: 1 addition & 0 deletions .idea/ModMultiLoaders.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 34 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions .idea/modules/IDEA.QueQiao.fabric-1.21.test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 17a9c76

Please sign in to comment.