diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml new file mode 100644 index 0000000..d4f0cec --- /dev/null +++ b/.github/workflows/build-and-release.yml @@ -0,0 +1,51 @@ +name: 构建和发布 + +on: [push, pull_request] + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: 使用 Node.js 16 + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: 安装 Lerna and PhantomJS + run: | + npm install -g lerna + npm install -g phantomjs + + - name: Lerna Bootstrap + run: lerna bootstrap + + - name: Build + run: | + cd packages/gui + npm run electron:build + + - name: 创建 Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: packages/gui/dist_electron/DevSidecar-*.exe + asset_name: DevSidecar-1.8.1.exe + asset_content_type: application/octet-stream \ No newline at end of file