mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
ci: add release ci
This commit is contained in:
@@ -1,12 +1,39 @@
|
|||||||
name: Build
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
info:
|
||||||
|
name: Parse release info
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.get_version.outputs.version }}
|
||||||
|
version-without-v: ${{ steps.get_version.outputs.version-without-v }}
|
||||||
|
changelog: ${{ steps.get_changelog.outputs.changelog }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.13'
|
||||||
|
|
||||||
|
- name: Get Version
|
||||||
|
id: get_version
|
||||||
|
uses: battila7/get-version-action@v2
|
||||||
|
|
||||||
|
- name: Get ChangeLog
|
||||||
|
id: get_changelog
|
||||||
|
working-directory: scripts
|
||||||
|
run:
|
||||||
|
changelog=$(python parse_changelog_of_version.py "${{ steps.get_version.outputs.version }}")
|
||||||
|
echo "changelog=${changelog}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
build-jar:
|
build-jar:
|
||||||
name: Build Jar
|
name: Build Jar
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ info ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -30,16 +57,17 @@ jobs:
|
|||||||
bun-version: latest
|
bun-version: latest
|
||||||
|
|
||||||
- name: Build Web with Bun
|
- name: Build Web with Bun
|
||||||
run: cd web && bun install --frozen-lockfile && bun run build
|
working-directory: web
|
||||||
|
run: bun install --frozen-lockfile && bun run build
|
||||||
|
|
||||||
- name: Build Boot with Gradle
|
- name: Build Boot with Gradle
|
||||||
run: ./gradlew :boot:bootjar -x test
|
run: ./gradlew -Pversion=${{ needs.info.outputs.version-without-v }} :boot:bootjar -x test
|
||||||
|
|
||||||
- name: Upload Boot Jar
|
- name: Upload Boot Jar
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: boot
|
name: boot
|
||||||
path: boot/build/libs/boot.jar
|
path: boot/build/libs/boot-${{ needs.info.outputs.version-without-v }}.jar
|
||||||
|
|
||||||
docker-push:
|
docker-push:
|
||||||
name: Docker Push
|
name: Docker Push
|
||||||
@@ -79,9 +107,29 @@ jobs:
|
|||||||
context: boot
|
context: boot
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ needs.info.outputs.version-without-v }}
|
||||||
tags: |
|
tags: |
|
||||||
docker.io/reajason/memshell-party:latest
|
docker.io/reajason/memshell-party:latest
|
||||||
|
docker.io/reajason/memshell-party:${{ needs.info.outputs.version-without-v }}
|
||||||
ghcr.io/reajason/memshell-party:latest
|
ghcr.io/reajason/memshell-party:latest
|
||||||
|
ghcr.io/reajason/memshell-party:${{ needs.info.outputs.version-without-v }}
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
name: Create Release
|
||||||
|
needs: [ docker-push ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
name: ${{ needs.info.outputs.version }}
|
||||||
|
tag: ${{ needs.info.outputs.version }}
|
||||||
|
body: ${{ needs.info.outputs.changelog }}
|
||||||
|
|
||||||
deploy-northflank:
|
deploy-northflank:
|
||||||
name: Deploy to Northflank
|
name: Deploy to Northflank
|
||||||
@@ -4,8 +4,8 @@
|
|||||||
<p>一键生成常见中间件框架内存马,让内存马测试变得简单高效,打造内存马的全方位学习平台</p>
|
<p>一键生成常见中间件框架内存马,让内存马测试变得简单高效,打造内存马的全方位学习平台</p>
|
||||||
<p>在遍地是轮子的时代,是时候造车,带着大伙加速冲冲冲了</p>
|
<p>在遍地是轮子的时代,是时候造车,带着大伙加速冲冲冲了</p>
|
||||||
|
|
||||||
[](https://github.com/ReaJason/MemShellParty/actions)
|
[](https://github.com/ReaJason/MemShellParty/actions/workflows/test.yaml)
|
||||||
[](https://github.com/ReaJason/MemShellParty/actions)
|
[](https://github.com/ReaJason/MemShellParty/actions/workflows/release.yaml)
|
||||||
[](https://github.com/ReaJason/MemShellParty?tab=MIT-1-ov-file)
|
[](https://github.com/ReaJason/MemShellParty?tab=MIT-1-ov-file)
|
||||||
[](https://t.me/memshell)
|
[](https://t.me/memshell)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import argparse
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
capture = False
|
||||||
|
result_lines = []
|
||||||
|
parser = argparse.ArgumentParser(description="Extract changelog for a specific version")
|
||||||
|
parser.add_argument("version", help="The version of the changelog to extract, e.g. 'v1.0.0'")
|
||||||
|
args = parser.parse_args()
|
||||||
|
version = args.version
|
||||||
|
|
||||||
|
with open("../CHANGELOG.md") as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
for line in lines:
|
||||||
|
if line.startswith(f"## [{version}]"):
|
||||||
|
capture = True
|
||||||
|
elif capture and line.startswith("## ["):
|
||||||
|
break
|
||||||
|
elif capture:
|
||||||
|
result_lines.append(line)
|
||||||
|
if not result_lines:
|
||||||
|
print("Specified version not found.", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
print("".join(result_lines).strip())
|
||||||
Reference in New Issue
Block a user