diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..dc690ea92f5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,52 @@ +name: build + +on: workflow_dispatch + +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + node-version: [16.x] + + steps: + - name: Checkout Source Code + uses: actions/checkout@v2 + with: + lfs: true + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://npm.pkg.github.com' + always-auth: true + scope: '@onekeyhq' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dep + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: 'yarn' + + - name: Build Static Linux / Macos / Windows Installer + run: 'cd packages/desktop && yarn build' + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: onekey-desktop + path: | + ./packages/desktop/build-electron/*.dmg + ./packages/desktop/build-electron/*.exe + ./packages/desktop/build-electron/*.AppImage diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8c3ded07cce..72d1c1ac95b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Node.js CI +name: lint on: pull_request: @@ -8,7 +8,7 @@ on: - onekey jobs: - build: + lint: runs-on: ubuntu-latest strategy: @@ -26,6 +26,18 @@ jobs: registry-url: 'https://npm.pkg.github.com' always-auth: true scope: '@onekeyhq' + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install Dependencies env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}