ctool.yml 2.1 KB
Newer Older
B
update  
baiy 已提交
1
name: Build Ctool
B
update  
baiy 已提交
2
on: [ push ]
B
baiy 已提交
3 4 5 6 7
jobs:
  deploy:
    runs-on: ubuntu-latest
    strategy:
      matrix:
B
update  
baiy 已提交
8
        node-version: [ 16.x ]
B
baiy 已提交
9
    steps:
B
update  
baiy 已提交
10 11 12
      - name: Checkout
        uses: actions/checkout@v2

B
baiy 已提交
13 14 15 16
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
B
update  
baiy 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

      - name: Initialize / Install Dependencies
        run: |
          mkdir temp_release
          npm install

      - name: Build web
        run: |
          npm run build -adapter=web
          cp -r ./dist ./dist_gh_pages
          cd ./dist
          zip -r -q ../temp_release/web.zip ./*
          cd ../
          unzip -l ./temp_release/web.zip

      - name: Build chrome
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=chrome
          cd ./dist
          zip -r -q ../temp_release/chrome.zip ./*
          cd ../

      - name: Build utools
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=utools
          cd ./dist
          zip -r -q ../temp_release/utools.zip ./*
          cd ../

      - name: Build edge
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=edge
          cd ./dist
          zip -r -q ../temp_release/edge.zip ./*
          cd ../

      - name: Build firefox
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=firefox
          cd ./dist
          zip -r -q ../temp_release/firefox.zip ./*
          cd ../

B
update  
baiy 已提交
64
      - name: Upload build to github
B
update  
baiy 已提交
65 66 67
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
B
update  
baiy 已提交
68
          prerelease: true
B
update  
baiy 已提交
69
          files: |
B
update  
baiy 已提交
70 71 72 73 74
            ./temp_release/web.zip
            ./temp_release/chrome.zip
            ./temp_release/utools.zip
            ./temp_release/edge.zip
            ./temp_release/firefox.zip
B
update  
baiy 已提交
75 76

      - name: Deploy web to gh-pages
B
baiy 已提交
77 78 79
        uses: peaceiris/actions-gh-pages@v3
        with:
          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
B
update  
baiy 已提交
80
          publish_dir: ./dist_gh_pages