From 0ded50e37cb2cb76696fd69bf003e62e9cffff08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E4=B8=AB=E8=AE=B2=E6=A2=B5?= Date: Wed, 22 Mar 2023 12:00:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B0=86dist?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=88=B0release=E7=9A=84action=20(#41)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dist-to-release.yml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/dist-to-release.yml diff --git a/.github/workflows/dist-to-release.yml b/.github/workflows/dist-to-release.yml new file mode 100644 index 0000000..90e214e --- /dev/null +++ b/.github/workflows/dist-to-release.yml @@ -0,0 +1,40 @@ +name: Build Release + +on: + release: + types: [created,published] # 表示在创建新的 Release 时触发 + +env: # 设置环境变量 + TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用时区时间) + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4 + + - name: build project ⚗️ + uses: actions/setup-node@v3 + with: + node-version: 14 + + - run: | + yarn + yarn build:prod + + - run: | + mkdir go-ldap-admin-ui + mv README.md LICENSE default.conf go-ldap-admin-ui + mv dist go-ldap-admin-ui + tar zcvf go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz go-ldap-admin-ui + md5 go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz > go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz.md5 + + - name: Upload release package + uses: softprops/action-gh-release@v1 + with: + files: | + go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz + go-ldap-admin-ui-${{ env.GITHUB_REF_NAME }}.tar.gz.md5 \ No newline at end of file