From fb8d9b88308e96c1aef2ab66d5298a7c6872a9cd Mon Sep 17 00:00:00 2001 From: Mist Date: Thu, 14 Mar 2024 15:17:48 +0800 Subject: [PATCH] [Feat] build plugin after released --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 59 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6b4415..fe5af2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,9 +7,67 @@ on: branches: - main +permissions: + contents: write + jobs: + build: + name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }} + runs-on: ${{ matrix.platform.os }} + strategy: + fail-fast: false + matrix: + platform: + - os_name: linux-x86_64 + os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + origin_dylib_suffix: so + dest_dylib_suffix: so + + - os_name: mac-x86_64 + os: macOS-latest + target: x86_64-apple-darwin + origin_dylib_suffix: dylib + dest_dylib_suffix: so + + - os_name: mac-aarch64 + os: macOS-latest + target: aarch64-apple-darwin + origin_dylib_suffix: dylib + dest_dylib_suffix: so + + toolchain: + - stable + steps: + - uses: actions/checkout@v3 + + - name: Build library + uses: houseabsolute/actions-rust-cross@v0 + with: + command: "build" + working-directory: ./generator + target: ${{ matrix.platform.target }} + toolchain: ${{ matrix.toolchain }} + args: "--release" + + - name: Rename dynamic lib + run: cp generator/target/${{ matrix.platform.target }}/release/libgenerator.${{ matrix.platform.origin_dylib_suffix }} lua/${{ matrix.platform.os_name }}generator.${{ matrix.platform.dest_dylib_suffix }} + + - name: Commit changes + uses: EndBug/add-and-commit@v7 + with: + message: '[Update] files based on generated files by template generator' + pull_strategy: 'NO-PULL' + push: false + + - name: Push changes + run: | + git pull --rebase + git push + release: runs-on: ubuntu-latest + needs: build steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index e03423c..83c193d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ node_modules # build output.css +generator.so