66 - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
77
88jobs :
9- test :
10- runs-on : ubuntu-latest
11- steps :
12- - name : Checkout
13- uses : actions/checkout@v2
14-
15- - name : Read .nvmrc
16- run : echo ::set-output name=NVMRC::$(cat .nvmrc)
17- id : nvm
18-
19- - name : Setup Node
20- uses : actions/setup-node@v1
21- with :
22- node-version : ' ${{ steps.nvm.outputs.NVMRC }}'
23-
24- - name : Install
25- run : |
26- yarn install
27-
28- - name : Build
29- run : yarn release
30-
31- - name : Artifact
32- uses : actions/upload-artifact@v2
33- with :
34- name : ubuntu-latest
35- path : dist
36-
37-
389 build :
39- needs : test
4010 strategy :
4111 fail-fast : true
42- matrix :
43- os : [macos-latest, windows-latest, ubuntu-latest]
4412 max-parallel : 3
45- runs-on : ${{ matrix.os }}
13+ runs-on : ubuntu-latest
4614 steps :
4715 - name : Checkout
4816 uses : actions/checkout@v2
@@ -61,12 +29,10 @@ jobs:
6129 yarn install
6230
6331 - name : Build
64- if : startsWith(matrix.os, 'macos')
6532 run : |
6633 yarn release
6734
6835 - name : Get Change
69- if : startsWith(matrix.os, 'ubuntu')
7036 id : changes
7137 run : |
7238 echo "# ${{ github.ref }}" > changes.txt
8652 echo ::set-output name=log::$(cat changes.txt)
8753
8854 - name : Upload change
89- if : startsWith(matrix.os, 'ubuntu')
9055 uses : actions/upload-artifact@v2
9156 with :
9257 name : changes
9560 - name : Artifact
9661 uses : actions/upload-artifact@v2
9762 with :
98- name : ${{ matrix.os }}
99- path : dist
63+ name : package
64+ path : package
10065
10166 release :
10267 needs : build
@@ -118,14 +83,11 @@ jobs:
11883 id : create_release
11984 uses : actions/create-release@v1
12085 env :
121- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
86+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
12287 with :
12388 tag_name : ${{ github.ref }}
12489 release_name : Release ${{ github.ref }}
125- # body: ${{ steps.changes.outputs.log }}
12690 body_path : changes.txt
127- # body: ${{ needs.build.outputs.log }}
128- # echo ::set-env name=FOO::$(echo -n "hello world")
12991 draft : false
13092 prerelease : false
13193
@@ -137,58 +99,24 @@ jobs:
13799 upload :
138100 needs : release
139101 runs-on : ubuntu-latest
140- strategy :
141- fail-fast : true
142- matrix :
143- os : [ubuntu-latest, macos-latest, windows-latest]
144- max-parallel : 3
145102 steps :
146103 - uses : actions/download-artifact@v2
147104 with :
148- name : ${{ matrix.os }}
105+ name : package
149106 path : ProjectExportAPI
150107
151108 - name : list path
152- if : startsWith(matrix.os, 'windows')
153- run : dir ProjectExportAPI
154-
155- - name : Compress folder
156- if : startsWith(matrix.os, 'windows')
157- run : cd ProjectExportAPI && 7za a ../ProjectExportAPI.zip
109+ run : ls -l ProjectExportAPI
158110
159111 - name : Compress folder
160- if : startsWith(matrix.os, 'windows') != true
161- run : zip -r ProjectExportAPI.zip ProjectExportAPI/*
162-
163- - name : Upload Linux Asset
164- if : startsWith(matrix.os, 'ubuntu')
165- uses : actions/upload-release-asset@v1
166- env :
167- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168- with :
169- upload_url : ${{ needs.release.outputs.upload_url }}
170- asset_path : ProjectExportAPI.zip
171- asset_name : ProjectExportAPI-linux.zip
172- asset_content_type : application/zip
173-
174- - name : Upload Mac Asset
175- if : startsWith(matrix.os, 'macos')
176- uses : actions/upload-release-asset@v1
177- env :
178- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
179- with :
180- upload_url : ${{ needs.release.outputs.upload_url }}
181- asset_path : ProjectExportAPI.zip
182- asset_name : ProjectExportAPI-mac.zip
183- asset_content_type : application/zip
112+ run : tar -cvzf ProjectExportAPI.tar.gz ProjectExportAPI
184113
185- - name : Upload Windows Asset
186- if : startsWith(matrix.os, 'windows')
114+ - name : Upload Asset
187115 uses : actions/upload-release-asset@v1
188116 env :
189117 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
190118 with :
191119 upload_url : ${{ needs.release.outputs.upload_url }}
192- asset_path : ProjectExportAPI.zip
193- asset_name : ProjectExportAPI-windows.zip
120+ asset_path : ProjectExportAPI.tar.gz
121+ asset_name : ProjectExportAPI.tar.gz
194122 asset_content_type : application/zip
0 commit comments