Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 6f5ea31

Browse files
On tag publish with GitHub Actions (GitHub Release + NPM) (#334)
1 parent 4649511 commit 6f5ea31

File tree

4 files changed

+34
-101
lines changed

4 files changed

+34
-101
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: CI
33
on:
44
push:
55
branches: [ master ]
6-
# run when tag received matching version format
6+
tags:
7+
- v*.*.*
78
pull_request:
89
branches: [ master ]
910

@@ -90,5 +91,34 @@ jobs:
9091
ls prebuilds/
9192
name: List prebuilds
9293
93-
# only if tag found for release
94-
#- if defined APPVEYOR_REPO_TAG_NAME (npm run upload)
94+
- name: Upload prebuilds to GitHub
95+
run: npm run upload
96+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
97+
env:
98+
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
100+
# Separate step for publishing to NPM so we're sure that generating + uploading prebuilds worked on all platforms
101+
npm-publish:
102+
needs: build
103+
name: Publish to NPM
104+
runs-on: ubuntu-20.04
105+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
106+
107+
steps:
108+
- uses: actions/checkout@v2
109+
- name: Use Node.js 15
110+
uses: actions/setup-node@v1
111+
with:
112+
node-version: 15.x
113+
registry-url: 'https://registry.npmjs.org'
114+
115+
- run: sudo apt-get install libsecret-1-dev
116+
name: Install additional dependencies
117+
118+
- run: npm install
119+
name: Setup environment
120+
121+
- run: npm publish --access public
122+
name: Upload to NPM
123+
env:
124+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.travis.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
"prebuild-electron": "prebuild -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -t 11.0.0 -r electron --strip",
4141
"prebuild-electron-arm64": "prebuild -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -t 11.0.0 -r electron -a arm64 --strip",
4242
"prebuild-electron-ia32": "prebuild -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -t 11.0.0 -r electron -a ia32 --strip",
43-
"upload": "node ./script/upload.js",
44-
"postpublish": "git push --follow-tags"
43+
"upload": "node ./script/upload.js"
4544
},
4645
"devDependencies": {
4746
"babel-core": "^6.26.3",

0 commit comments

Comments
 (0)