Skip to content

Commit cea25ff

Browse files
authored
Create main.yml
1 parent 325d3f3 commit cea25ff

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Build MPK
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [master, main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
build:
18+
name: 构建MPK 和 DEMO项目
19+
permissions: write-all
20+
# The type of runner that the job will run on
21+
runs-on: ubuntu-latest
22+
23+
# Steps represent a sequence of tasks that will be executed as part of the job
24+
steps:
25+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26+
- uses: actions/checkout@v2
27+
with:
28+
submodules: true
29+
- uses: actions/setup-node@v3
30+
with:
31+
node-version: 16
32+
cache: "npm"
33+
- name: Get package info
34+
id: package
35+
uses: codex-team/action-nodejs-package-info@v1
36+
- name: Install Dependencies
37+
run: |
38+
npm ci
39+
env:
40+
NODE_OPTIONS: --max_old_space_size=4096
41+
- name: npm run release
42+
run: |
43+
npm run release
44+
env:
45+
NODE_OPTIONS: --max_old_space_size=4096
46+
- name: "package MPK files"
47+
uses: marvinpinto/action-automatic-releases@v1.2.1
48+
with:
49+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
50+
automatic_release_tag: "${{ steps.package.outputs.name }}-v${{ steps.package.outputs.version }}"
51+
prerelease: false
52+
title: "${{ steps.package.outputs.widgetName }}"
53+
files: |
54+
dist/**/*.mpk

0 commit comments

Comments
 (0)