Skip to content

Commit

Permalink
chore: add miscellaneous stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Oct 9, 2023
1 parent af5e9bb commit b552ce2
Show file tree
Hide file tree
Showing 22 changed files with 1,068 additions and 290 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github: LiteLDev
open_collective: liteloaderbds
custom:
- https://afdian.net/@liteldev
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Bug Report
description: Create a report to help us improve
title: "[Bug]: "
labels: ["bug"]
body:
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior.
validations:
required: true

- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true

- type: textarea
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.

- type: input
attributes:
label: Platform
description: The platform you are using. (e.g. Windows 10, macOS 10.15, Ubuntu 20.04)

- type: input
attributes:
label: Version
description: The version of the application you are using. (e.g. 1.0.0)

- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Feature request
description: Suggest an idea for this project
title: "[Feature]: "
labels: ["enhancement"]
body:
- type: textarea
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true

- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true

- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.

- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## What does this PR do?



## Which issues does this PR resolve?



## Checklist before merging

Thank you for your contribution to the repository.
Before submitting this PR, please make sure:

- [ ] Your code builds clean without any errors or warnings
- [ ] Your code follows the code style of this repository (see the wiki)
- [ ] You have tested all functions
- [ ] You have not used code without license
- [ ] You have added statement for third-party code
160 changes: 35 additions & 125 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,142 +1,52 @@
name: Build
env:
VERSION: v0.0.0
ZIP_SHA256: ""
DLL_SHA256: ""
PDB_SHA256: ""
LIB_SHA256: ""
on:
push:
paths:
- "**.cpp"
- "**.cc"
- "**.cxx"
- "**.c"
- "**.hpp"
- "**.hh"
- "**.hxx"
- "**.h"
- ".github/workflows/build.yml"
- "**/*.lua"
pull_request:
release:
types:
- created
push:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: windows-latest
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup XMake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest

- name: Cache XMake
uses: actions/cache@v3
with:
path: |
~/AppData/Local/.xmake
./.xmake
key: ${{ runner.os }}-xmake-${{ github.sha }}
restore-keys: |
${{ runner.os }}-xmake-
- name: Update XMake Repository
run: xmake repo -u
- uses: actions/checkout@v4

- name: Get Release Version Tag
if: github.event_name == 'release'
run: echo "VERSION=${{ github.ref_name }}" >> $env:GITHUB_ENV
- run: |
pip install -r requirements.txt
- name: Get Previous Tag
if: github.event_name != 'release'
id: previoustag
run: |
$tag = ((git ls-remote -t --refs --sort=-v:refname -q | select -first 1) -split "/")[2]
if ($tag -eq "" -or $tag -eq $null) {
$tag = "v0.0.0"
}
echo "tag=$tag" >> $env:GITHUB_OUTPUT
- run: |
mkdocs build
- name: Set Pseudo Version
if: github.event_name != 'release'
run: |
$date = (Get-Date -Format "yyyyMMddHHmmss")
$commit = git rev-parse --short HEAD
$previous_tag = "${{ steps.previoustag.outputs.tag }}"
echo "VERSION=$previous_tag-$date-$commit" >> $env:GITHUB_ENV
- name: Build liteloader
run: |
xmake f -p windows -m release -a x64 --ccache=n -y -v
xmake -w -y
- name: Prepare Artifacts
run: |
mkdir artifacts
cp build/windows/x64/release/LiteLoader.dll artifacts
cp build/windows/x64/release/LiteLoader.lib artifacts
cp build/windows/x64/release/LiteLoader.pdb artifacts
mv artifacts liteloader-${{ env.VERSION }}-windows-amd64
mkdir artifacts
mv liteloader-${{ env.VERSION }}-windows-amd64 artifacts/
- name: Upload Artifacts
uses: actions/upload-artifact@v3
- uses: actions/upload-pages-artifact@v2
with:
name: liteloader-${{ env.VERSION }}-windows-amd64
path: artifacts

upload-to-release:
name: Upload to Release
needs:
- build
path: site/

deploy-docs:
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
if: github.ref == 'refs/heads/develop' && github.event_name == 'push' # For development only
needs: build-docs
permissions:
id-token: write
pages: write
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/deploy-pages@v2

build-liteloader:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Get Version
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- uses: xmake-io/github-action-setup-xmake@v1

- name: Download Artifacts
uses: actions/download-artifact@v3
- run: |
xmake repo --update
- run: |
xmake config --arch=x64 --plat=windows --mode=release --verbose --yes
- name: Compress Artifacts
id: compress
run: |
mv liteloader-${{ env.VERSION }}-windows-amd64 artifacts
mv artifacts/liteloader-${{ env.VERSION }}-windows-amd64 .
cp -r include liteloader-${{ env.VERSION }}-windows-amd64/
zip -r liteloader-${{ env.VERSION }}-windows-amd64.zip liteloader-${{ env.VERSION }}-windows-amd64
echo "ZIP_SHA256=$(sha256sum liteloader-${{ env.VERSION }}-windows-amd64.zip | cut -d ' ' -f 1)" >> $GITHUB_ENV
echo "DLL_SHA256=$(sha256sum liteloader-${{ env.VERSION }}-windows-amd64/LiteLoader.dll | cut -d ' ' -f 1)" >> $GITHUB_ENV
echo "LIB_SHA256=$(sha256sum liteloader-${{ env.VERSION }}-windows-amd64/LiteLoader.lib | cut -d ' ' -f 1)" >> $GITHUB_ENV
echo "PDB_SHA256=$(sha256sum liteloader-${{ env.VERSION }}-windows-amd64/LiteLoader.pdb | cut -d ' ' -f 1)" >> $GITHUB_ENV
shell: bash
- run: |
xmake --warning --yes
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
- uses: actions/upload-artifact@v3
with:
append_body: true
files: |
liteloader-${{ env.VERSION }}-windows-amd64.zip
liteloader-${{ env.VERSION }}-windows-amd64/LiteLoader.dll
liteloader-${{ env.VERSION }}-windows-amd64/LiteLoader.lib
liteloader-${{ env.VERSION }}-windows-amd64/LiteLoader.pdb
body: |
---
| File | SHA256 |
| :--------------------------------------------- | :-------------------- |
| liteloader-${{ env.VERSION }}-windows-amd64.zip | ${{ env.ZIP_SHA256 }} |
| LiteLoader.dll | ${{ env.DLL_SHA256 }} |
| LiteLoader.lib | ${{ env.LIB_SHA256 }} |
| LiteLoader.pdb | ${{ env.PDB_SHA256 }} |
name: liteloader-windows-x64-${{ github.sha }}
path: build/windows/x64/release/
Loading

0 comments on commit b552ce2

Please sign in to comment.