|
1 | 1 | name: Build/release |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - release |
7 | | - paths: |
8 | | - - '!**' |
9 | | - - 'src/main' |
10 | | - - 'src/renderer' |
11 | | - - 'package.json' |
12 | | - - 'package-lock.json' |
13 | | - - 'release/app/package-lock.json' |
14 | | - - 'release/app/package-lock.json' |
15 | | - |
16 | | - workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - release |
| 7 | + paths: |
| 8 | + - '!**' |
| 9 | + - 'src/main' |
| 10 | + - 'src/renderer' |
| 11 | + - 'package.json' |
| 12 | + - 'package-lock.json' |
| 13 | + - 'release/app/package-lock.json' |
| 14 | + - 'release/app/package-lock.json' |
| 15 | + |
| 16 | + workflow_dispatch: |
17 | 17 |
|
18 | 18 | jobs: |
19 | | - init: |
20 | | - # if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}} |
21 | | - runs-on: ubuntu-latest |
22 | | - steps: |
23 | | - - name: 'checkout' |
24 | | - uses: actions/checkout@v1 |
25 | | - |
26 | | - - name: 'Get Release Tag' |
27 | | - id: release_tag |
28 | | - uses: 'WyriHaximus/github-action-get-previous-tag@v1' |
29 | | - |
30 | | - - name: 'create release_tag file' |
31 | | - run: | |
32 | | - echo ${{steps.release_tag.outputs.tag}} > release_tag.txt |
33 | | -
|
34 | | - - name: 'Upload Tag Artifact' |
35 | | - uses: actions/upload-artifact@v2 |
36 | | - with: |
37 | | - name: 'release_tag' |
38 | | - path: | |
39 | | - ./release_tag.txt |
40 | | - retention-days: 1 |
41 | | - |
42 | | - build: |
43 | | - needs: init |
44 | | - # if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}} |
45 | | - runs-on: ubuntu-latest |
46 | | - |
47 | | - steps: |
48 | | - - name: Check out Git repository |
49 | | - uses: actions/checkout@v2 |
50 | | - |
51 | | - - name: Build Sphinx Documenaton |
52 | | - run: | |
53 | | - sudo apt update -y |
54 | | - sudo apt-get install python3-sphinx -y |
55 | | - pip install sphinx_rtd_theme |
56 | | - sudo apt-get install -y latexmk |
57 | | - sudo apt-get install -y texlive-latex-recommended |
58 | | - sudo apt-get install -y texlive-latex-extra |
59 | | - cd docs |
60 | | - make latexpdf |
61 | | - cd ../ |
62 | | -
|
63 | | - - name: 'Upload PDF Artifact' |
64 | | - uses: actions/upload-artifact@v2 |
65 | | - with: |
66 | | - name: 'docs_build' |
67 | | - path: | |
68 | | - ./docs/_build/latex/CpgUIClient.pdf |
69 | | - retention-days: 1 |
70 | | - |
71 | | - - name: Install Node.js, NPM and Yarn |
72 | | - uses: actions/setup-node@v1 |
73 | | - with: |
74 | | - node-version: 16 |
75 | | - |
76 | | - - name: Build Electron app |
77 | | - run: | |
78 | | - npm install |
79 | | - npm run build |
80 | | - npm --prefix ./release/app install @electron-forge/cli -D |
81 | | - npm --prefix ./release/app install @electron-forge/plugin-auto-unpack-natives -D |
82 | | - npx --workspace ./release/app electron-forge import |
83 | | - npx --workspace ./release/app electron-forge make |
84 | | -
|
85 | | - - name: 'Upload Ubuntu Artifacts' |
86 | | - uses: actions/upload-artifact@v2 |
87 | | - # if: matrix.os == 'ubuntu-latest' |
88 | | - with: |
89 | | - name: 'ubuntu_build' |
90 | | - path: | |
91 | | - ./release/app/out/**/ui-client*.* |
92 | | - retention-days: 1 |
93 | | - |
94 | | - # - name: 'Upload Macos Artifacts' |
95 | | - # uses: actions/upload-artifact@v2 |
96 | | - # if: matrix.os == 'macos-latest' |
97 | | - # with: |
98 | | - # name: 'macos_build' |
99 | | - # path: | |
100 | | - # ./out/make/zip/darwin/x64/ui-client-darwin-x64*.zip |
101 | | - # retention-days: 1 |
102 | | - |
103 | | - release: |
104 | | - needs: build |
105 | | - # if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}} |
106 | | - runs-on: ubuntu-latest |
107 | | - steps: |
108 | | - - name: 'checkout' |
109 | | - uses: actions/checkout@v2 |
110 | | - |
111 | | - - name: 'Download Artifacts' |
112 | | - uses: actions/download-artifact@v2 |
113 | | - |
114 | | - - name: 'Write content of release_tag artifact to steps' |
115 | | - id: cat_to_steps |
116 | | - run: echo ::set-output name=release_tag::$(cat ./release_tag/release_tag.txt) |
117 | | - |
118 | | - - name: Release Electron app |
119 | | - uses: 'marvinpinto/action-automatic-releases@latest' |
120 | | - with: |
121 | | - repo_token: '${{ secrets.GITHUB_TOKEN }}' |
122 | | - automatic_release_tag: ${{ steps.cat_to_steps.outputs.release_tag }} |
123 | | - prerelease: true |
124 | | - files: | |
125 | | - ./ubuntu_build/**/ui-client*.* |
126 | | - ./docs_build/CpgUIClient.pdf |
127 | | - # ./macos_build/ui-client*.* |
| 19 | + init: |
| 20 | + # if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}} |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - name: 'checkout' |
| 24 | + uses: actions/checkout@v1 |
| 25 | + |
| 26 | + - name: 'Get Release Tag' |
| 27 | + id: release_tag |
| 28 | + uses: 'WyriHaximus/github-action-get-previous-tag@v1' |
| 29 | + |
| 30 | + - name: 'create release_tag file' |
| 31 | + run: | |
| 32 | + echo ${{steps.release_tag.outputs.tag}} > release_tag.txt |
| 33 | +
|
| 34 | + - name: 'Upload Tag Artifact' |
| 35 | + uses: actions/upload-artifact@v2 |
| 36 | + with: |
| 37 | + name: 'release_tag' |
| 38 | + path: | |
| 39 | + ./release_tag.txt |
| 40 | + retention-days: 1 |
| 41 | + |
| 42 | + build: |
| 43 | + needs: init |
| 44 | + # if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}} |
| 45 | + runs-on: ubuntu-latest |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Check out Git repository |
| 49 | + uses: actions/checkout@v2 |
| 50 | + |
| 51 | + - name: Build Sphinx Documenaton |
| 52 | + run: | |
| 53 | + sudo apt update -y |
| 54 | + sudo apt-get install python3-sphinx -y |
| 55 | + pip install sphinx_rtd_theme |
| 56 | + sudo apt-get install -y latexmk |
| 57 | + sudo apt-get install -y texlive-latex-recommended |
| 58 | + sudo apt-get install -y texlive-latex-extra |
| 59 | + cd docs |
| 60 | + make latexpdf |
| 61 | + cd ../ |
| 62 | +
|
| 63 | + - name: 'Upload PDF Artifact' |
| 64 | + uses: actions/upload-artifact@v2 |
| 65 | + with: |
| 66 | + name: 'docs_build' |
| 67 | + path: | |
| 68 | + ./docs/_build/latex/CpgUIClient.pdf |
| 69 | + retention-days: 1 |
| 70 | + |
| 71 | + - name: Install Node.js, NPM and Yarn |
| 72 | + uses: actions/setup-node@v1 |
| 73 | + with: |
| 74 | + node-version: 16 |
| 75 | + |
| 76 | + - name: Build Electron app |
| 77 | + run: | |
| 78 | + npm install --legacy-peer-deps |
| 79 | + npm --prefix ./release/app install |
| 80 | + npm run build |
| 81 | + npm --prefix ./release/app install @electron-forge/cli -D |
| 82 | + npm --prefix ./release/app install @electron-forge/plugin-auto-unpack-natives -D |
| 83 | + cd ./release/app && npx electron-forge import && npx electron-forge make |
| 84 | +
|
| 85 | + - name: 'Upload Ubuntu Artifacts' |
| 86 | + uses: actions/upload-artifact@v2 |
| 87 | + # if: matrix.os == 'ubuntu-latest' |
| 88 | + with: |
| 89 | + name: 'ubuntu_build' |
| 90 | + path: | |
| 91 | + ./release/app/out/**/ui-client*.* |
| 92 | + retention-days: 1 |
| 93 | + |
| 94 | + # - name: 'Upload Macos Artifacts' |
| 95 | + # uses: actions/upload-artifact@v2 |
| 96 | + # if: matrix.os == 'macos-latest' |
| 97 | + # with: |
| 98 | + # name: 'macos_build' |
| 99 | + # path: | |
| 100 | + # ./out/make/zip/darwin/x64/ui-client-darwin-x64*.zip |
| 101 | + # retention-days: 1 |
| 102 | + |
| 103 | + release: |
| 104 | + needs: build |
| 105 | + # if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}} |
| 106 | + runs-on: ubuntu-latest |
| 107 | + steps: |
| 108 | + - name: 'checkout' |
| 109 | + uses: actions/checkout@v2 |
| 110 | + |
| 111 | + - name: 'Download Artifacts' |
| 112 | + uses: actions/download-artifact@v2 |
| 113 | + |
| 114 | + - name: 'Write content of release_tag artifact to steps' |
| 115 | + id: cat_to_steps |
| 116 | + run: echo ::set-output name=release_tag::$(cat ./release_tag/release_tag.txt) |
| 117 | + |
| 118 | + - name: Release Electron app |
| 119 | + uses: 'marvinpinto/action-automatic-releases@latest' |
| 120 | + with: |
| 121 | + repo_token: '${{ secrets.GITHUB_TOKEN }}' |
| 122 | + automatic_release_tag: ${{ steps.cat_to_steps.outputs.release_tag }} |
| 123 | + prerelease: true |
| 124 | + files: | |
| 125 | + ./ubuntu_build/**/ui-client*.* |
| 126 | + ./docs_build/CpgUIClient.pdf |
| 127 | + # ./macos_build/ui-client*.* |
0 commit comments