|
9 | 9 | push: |
10 | 10 | tags: |
11 | 11 | - v* |
12 | | - branches: [ master, actions ] |
| 12 | + branches: [ master, appimage ] |
13 | 13 | pull_request: |
14 | 14 | branches: [ master ] |
15 | 15 | # # Allows you to run this workflow manually from the Actions tab |
16 | 16 | # workflow_dispatch: |
17 | 17 |
|
18 | 18 | jobs: |
19 | 19 | build: |
20 | | - |
21 | 20 | name: Build |
22 | 21 | runs-on: ubuntu-latest |
23 | 22 |
|
24 | 23 | strategy: |
25 | 24 | matrix: |
26 | 25 | node-version: [16.x] |
| 26 | + ARCH: ['x86_64'] |
27 | 27 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
28 | 28 |
|
29 | 29 | steps: |
30 | | - - uses: actions/checkout@v2 |
31 | | - - name: Use Node.js ${{ matrix.node-version }} |
32 | | - uses: actions/setup-node@v2 |
33 | | - with: |
34 | | - node-version: ${{ matrix.node-version }} |
35 | | - cache: 'npm' |
| 30 | + - uses: actions/checkout@v2 |
| 31 | + - name: Use Node.js ${{ matrix.node-version }} |
| 32 | + uses: actions/setup-node@v2 |
| 33 | + with: |
| 34 | + node-version: ${{ matrix.node-version }} |
| 35 | + cache: 'npm' |
36 | 36 |
|
37 | | - - name: Prepare |
38 | | - run: | |
39 | | - pwd |
40 | | - ls -l |
41 | | - chmod 777 docker/entrypoint |
42 | | - chmod 777 tools/* |
43 | | - export ACTION_MODE=true |
44 | | - npm uninstall node-gyp -g |
45 | | - npm install node-gyp nw-gyp npm -g |
| 37 | + - name: Prepare |
| 38 | + run: | |
| 39 | + pwd |
| 40 | + ls -l |
| 41 | + export ACTION_MODE=true |
| 42 | + npm uninstall node-gyp -g |
| 43 | + npm install node-gyp nw-gyp npm -g |
| 44 | +
|
| 45 | + - id: tag |
| 46 | + run: | |
| 47 | + tag='continuous' |
| 48 | + name='Continuous Build' |
| 49 | + if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then |
| 50 | + tag='${{ github.ref_name }}' |
| 51 | + name='${{ github.ref_name }}' |
| 52 | + fi |
| 53 | + echo "tag result: $tag - $name" |
| 54 | + echo "::set-output name=tag::$tag" |
| 55 | + echo "::set-output name=name::$name" |
| 56 | +
|
| 57 | + - name: Build |
| 58 | + run: docker-compose up |
46 | 59 |
|
47 | | - - name: Build |
48 | | - run: docker-compose up |
| 60 | + - name: Build AppImage |
| 61 | + run: | |
| 62 | + sudo chmod -R 777 tmp package.nw node |
| 63 | + bash tools/appimage.sh |
| 64 | + wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" |
| 65 | + chmod a+x appimagetool-x86_64.AppImage |
| 66 | + ./appimagetool-x86_64.AppImage ./tmp/AppDir |
| 67 | + env: |
| 68 | + name: 'release-${{ github.ref_name }}' |
| 69 | + ARCH: '${{ matrix.ARCH }}' |
49 | 70 |
|
50 | | - - name: Delete unused file |
51 | | - run: | |
52 | | - sudo rm -rf cache tmp |
53 | | - mkdir ${{ env. name }} |
54 | | - sudo find -maxdepth 1 -not -name ${{ env.name }} -not -name . -exec mv {} ${{ env.name }} \; |
55 | | - sudo cp -r "${{ env.name }}/package.nw/node_modules/nodegit" nodegit |
56 | | - sudo cp -r "${{ env.name }}/compiler" compiler |
57 | | - ls -ls |
58 | | - env: |
59 | | - name: 'release-${{ github.ref_name }}' |
| 71 | + - name: Delete unused file |
| 72 | + run: | |
| 73 | + ls -l |
| 74 | + sudo rm -rf cache tmp appimagetool-x86_64.AppImage |
| 75 | + mkdir ${{ env. name }} |
| 76 | + sudo find -maxdepth 1 -not -name ${{ env.name }} -not -name . -exec mv {} ${{ env.name }} \; |
| 77 | + sudo cp -r "${{ env.name }}/package.nw/node_modules/nodegit" nodegit |
| 78 | + sudo cp -r "${{ env.name }}/compiler" compiler |
| 79 | + sudo mv ${{ env.name }}/WeChat*.AppImage . |
| 80 | + ls -l |
| 81 | + cd "${{ env.name }}" |
| 82 | + env: |
| 83 | + name: 'release-${{ github.ref_name }}' |
| 84 | + |
| 85 | + - name: Compress |
| 86 | + run: | |
| 87 | + ls -l |
| 88 | + tar -zvcf ${{ env.name }}.tar.gz ${{ env.name }} |
| 89 | + tar -zvcf compiler.tar.gz compiler |
| 90 | + tar -zvcf nodegit.tar.gz nodegit |
| 91 | + sudo rm -rf ${{ env.name }} compiler nodegit |
| 92 | + ls -l |
| 93 | + env: |
| 94 | + name: 'release-${{ github.ref_name }}' |
60 | 95 |
|
61 | | - - name: Release |
62 | | - uses: fnkr/github-action-ghr@v1 |
63 | | - if: startsWith(github.ref, 'refs/tags/') |
64 | | - env: |
65 | | - GHR_COMPRESS: xz |
66 | | - GHR_PATH: . |
67 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 96 | + - name: Release |
| 97 | + uses: softprops/action-gh-release@v1 |
| 98 | + with: |
| 99 | + # note you'll typically need to create a personal access token |
| 100 | + # with permissions to create releases in the other repo |
| 101 | + name: ${{ steps.tag.outputs.name }} |
| 102 | + tag_name: ${{ steps.tag.outputs.tag }} |
| 103 | + files: | |
| 104 | + ${{ env.name }}.tar.gz |
| 105 | + compiler.tar.gz |
| 106 | + nodegit.tar.gz |
| 107 | + *.AppImage |
| 108 | + env: |
| 109 | + name: 'release-${{ github.ref_name }}' |
0 commit comments