Skip to content

Commit

Permalink
[Feat] build plugin after released
Browse files Browse the repository at this point in the history
  • Loading branch information
mistricky committed Mar 14, 2024
1 parent 2bf336e commit fb8d9b8
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ node_modules

# build
output.css
generator.so

0 comments on commit fb8d9b8

Please sign in to comment.