13
13
14
14
with :
15
15
access_token : ${{ github.token }}
16
- release :
16
+ build :
17
17
name : Release ${{ matrix.os }}
18
18
strategy :
19
19
fail-fast : false
34
34
with :
35
35
command : build
36
36
args : --release
37
- - name : Upload Mac / Linus Binaries to release
37
+ - name : Upload Mac / Linux Binaries
38
+ if : ${{ matrix.os != 'windows-latest' }}
39
+ uses : actions/upload-artifact@v2
40
+ with :
41
+ name : ${{ matrix.os }}
42
+ path : target/release/rewatch
43
+ retention-days : 1
44
+ - name : Upload Windows Binaries
45
+ if : ${{ matrix.os == 'windows-latest' }}
46
+ uses : actions/upload-artifact@v2
47
+ with :
48
+ name : ${{ matrix.os }}
49
+ path : target/release/rewatch.exe
50
+ retention-days : 1
51
+ - name : Attach Mac / Linux Binaries to release
38
52
if : ${{ matrix.os != 'windows-latest' }}
39
53
uses : svenstaro/upload-release-action@v2
40
54
with :
@@ -43,12 +57,44 @@ jobs:
43
57
asset_name : rewatch-${{ matrix.os }}
44
58
tag : ${{ github.ref }}
45
59
overwrite : true
46
- - name : Upload Windows Binaries to release
47
- if : ${{ matrix.os ! = 'windows-latest' }}
60
+ - name : Attach Windows Binaries to release
61
+ if : ${{ matrix.os = = 'windows-latest' }}
48
62
uses : svenstaro/upload-release-action@v2
49
63
with :
50
64
repo_token : ${{ secrets.GITHUB_TOKEN }}
51
65
file : target/release/rewatch.exe
52
66
asset_name : rewatch-${{ matrix.os }}
53
67
tag : ${{ github.ref }}
54
68
overwrite : true
69
+
70
+ npm-release :
71
+ name : NPM Release
72
+ runs-on : ubuntu-latest
73
+ if : github.event.action == 'published'
74
+ needs :
75
+ - build
76
+ steps :
77
+ - name : Checkout
78
+ uses : actions/checkout@v2
79
+ with :
80
+ ref : ${{ github.ref }}
81
+
82
+ - name : Download Artifacts
83
+ uses : actions/download-artifact@v2
84
+
85
+ - name : Move / Rename Artifacts
86
+ run : |
87
+ mv ubuntu-latest/rewatch ./rewatch-linux
88
+ mv macos-latest/rewatch ./rewatch-macos
89
+ mv windows-latest/rewatch.exe ./rewatch-windows.exe
90
+
91
+ - uses : actions/setup-node@v1
92
+ with :
93
+ always-auth : true
94
+ registry-url : " https://registry.npmjs.org"
95
+
96
+ - env :
97
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
98
+ run : |
99
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
100
+ yarn publish
0 commit comments