From fe14dc888805530fe92f24bc74ec8c251b516dc4 Mon Sep 17 00:00:00 2001 From: William So Date: Thu, 11 Jan 2024 11:53:20 +0800 Subject: [PATCH] Add CI workflow Signed-off-by: William So --- .github/workflows/build.yml | 33 +++++++++++++++++++ .../{latest.yml => release-latest.yml} | 17 +--------- 2 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{latest.yml => release-latest.yml} (65%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c76d09f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: actions/setup-node@v3 + with: + cache: npm + node-version: '*' + - run: npm ci + - run: npm run build + build-pnpm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: pnpm/action-setup@v2 + with: + version: '*' + - uses: actions/setup-node@v3 + with: + cache: pnpm + node-version: '*' + - run: pnpm install + - run: pnpm build +on: + pull_request_target: + push: + workflow_dispatch: +permissions: {} diff --git a/.github/workflows/latest.yml b/.github/workflows/release-latest.yml similarity index 65% rename from .github/workflows/latest.yml rename to .github/workflows/release-latest.yml index 834310c..d8bfdd5 100644 --- a/.github/workflows/latest.yml +++ b/.github/workflows/release-latest.yml @@ -1,5 +1,5 @@ jobs: - build: + release-latest: permissions: contents: write runs-on: ubuntu-latest @@ -21,21 +21,6 @@ jobs: GH_TOKEN: ${{github.token}} run: | gh release upload latest .github/*.tgz --clobber - build-pnpm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - uses: pnpm/action-setup@v2 - with: - version: '*' - - uses: actions/setup-node@v3 - with: - cache: pnpm - node-version: '*' - - run: pnpm install - - run: pnpm build on: push: tags: