Skip to content
Merged
Show file tree
Hide file tree
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
59 changes: 0 additions & 59 deletions .github/workflows/build-for-x86_64.yml

This file was deleted.

115 changes: 64 additions & 51 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,74 @@
name: Build
name: Build x86_64 wrapper

on:
workflow_dispatch: # 允许手动触发
workflow_dispatch:
push:
branches: [ "main", "lyjw" ]
branches: [main]
pull_request:
branches: [ "main" ]
branches: [main]

permissions:
contents: write

concurrency:
group: wrapper-x86_64-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Install aria2
run: sudo apt install aria2 -y

- name: Install LLVM
run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"

- name: Set up Android NDK r23b
run: |
aria2c -o android-ndk-r23b-linux.zip https://dl.google.com/android/repository/android-ndk-r23b-linux.zip
unzip -q -d . android-ndk-r23b-linux.zip

- name: Build
run: |
mkdir build
cd build
cmake ..
make

- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Wrapper.x86_64.${{ steps.vars.outputs.sha_short }}
include-hidden-files: true
path: |
rootfs
wrapper
Dockerfile

- name: Create Release Zip File
run: zip -r Wrapper.x86_64.${{ steps.vars.outputs.sha_short }}.zip rootfs/ wrapper Dockerfile

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: Wrapper.x86_64.${{ steps.vars.outputs.sha_short }}.zip
body: ${{ github.event.head_commit.message }}
name: Wrapper.x86_64.${{ steps.vars.outputs.sha_short }}
tag_name: Wrapper.x86_64.${{ steps.vars.outputs.sha_short }}
make_latest: true

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y aria2 cmake ninja-build

- name: Download Android NDK r23b
run: |
aria2c -o android-ndk-r23b-linux.zip \
https://dl.google.com/android/repository/android-ndk-r23b-linux.zip
unzip -q android-ndk-r23b-linux.zip

- name: Build x86_64 wrapper
run: |
cmake -S . -B build -G Ninja
cmake --build build

- name: Set artifact metadata
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- name: Package x86_64 wrapper
run: |
zip -r Wrapper.x86_64.latest.zip \
rootfs/ wrapper wrapper-rootless Dockerfile compose.yaml entrypoint.sh

- name: Upload x86_64 artifact
uses: actions/upload-artifact@v4
with:
name: Wrapper.x86_64.${{ steps.vars.outputs.sha_short }}
path: Wrapper.x86_64.latest.zip
if-no-files-found: error

- name: Move latest tag
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git tag -f wrapper.x86_64.latest
git push origin wrapper.x86_64.latest --force

- name: Publish latest x86_64 release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
tag_name: wrapper.x86_64.latest
name: Wrapper.x86_64.latest
body: |
Latest x86_64 wrapper build.
Commit: ${{ github.sha }}
files: Wrapper.x86_64.latest.zip
make_latest: true
48 changes: 0 additions & 48 deletions .github/workflows/wrapper-qemu.yml

This file was deleted.

Loading