1313 uses : styfle/cancel-workflow-action@0.9.0
1414 with :
1515 access_token : ${{ github.token }}
16- release :
16+ build :
1717 name : Release ${{ matrix.os }}
1818 strategy :
1919 fail-fast : false
3434 with :
3535 command : build
3636 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
3852 if : ${{ matrix.os != 'windows-latest' }}
3953 uses : svenstaro/upload-release-action@v2
4054 with :
@@ -43,12 +57,44 @@ jobs:
4357 asset_name : rewatch-${{ matrix.os }}
4458 tag : ${{ github.ref }}
4559 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' }}
4862 uses : svenstaro/upload-release-action@v2
4963 with :
5064 repo_token : ${{ secrets.GITHUB_TOKEN }}
5165 file : target/release/rewatch.exe
5266 asset_name : rewatch-${{ matrix.os }}
5367 tag : ${{ github.ref }}
5468 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