forked from mirror/codesnap.nvim
[Fix] extract build job as a separator workflow (#68)
parent
42ee8bf327
commit
45804b3341
|
@ -0,0 +1,64 @@
|
|||
on:
|
||||
push:
|
||||
paths:
|
||||
generator/**
|
||||
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 link lib
|
||||
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 -rf 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] generator link library on ${{ matrix.platform.os_name }}'
|
||||
pull_strategy: 'NO-PULL'
|
||||
push: false
|
||||
|
||||
- name: Push changes
|
||||
run: |
|
||||
git pull --rebase
|
||||
git push
|
|
@ -11,68 +11,22 @@ 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 link lib
|
||||
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 -rf 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] generator link library on ${{ matrix.platform.os_name }}'
|
||||
pull_strategy: 'NO-PULL'
|
||||
push: false
|
||||
|
||||
- name: Push changes
|
||||
run: |
|
||||
git pull --rebase
|
||||
git push
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Wait for build workflow to succeed
|
||||
uses: lewagon/wait-on-check-action@v1.3.4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
check-regexp: 'with rust'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
wait-interval: 10
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Setup python
|
||||
uses: actions/setup-python@v5
|
||||
|
|
Loading…
Reference in New Issue