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

Commit

Permalink
On tag publish with GitHub Actions (GitHub Release + NPM) (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisameling committed Mar 12, 2021
1 parent 4649511 commit 6f5ea31
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 101 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: CI
on:
push:
branches: [ master ]
# run when tag received matching version format
tags:
- v*.*.*
pull_request:
branches: [ master ]

Expand Down Expand Up @@ -90,5 +91,34 @@ jobs:
ls prebuilds/
name: List prebuilds
# only if tag found for release
#- if defined APPVEYOR_REPO_TAG_NAME (npm run upload)
- name: Upload prebuilds to GitHub
run: npm run upload
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Separate step for publishing to NPM so we're sure that generating + uploading prebuilds worked on all platforms
npm-publish:
needs: build
name: Publish to NPM
runs-on: ubuntu-20.04
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2
- name: Use Node.js 15
uses: actions/setup-node@v1
with:
node-version: 15.x
registry-url: 'https://registry.npmjs.org'

- run: sudo apt-get install libsecret-1-dev
name: Install additional dependencies

- run: npm install
name: Setup environment

- run: npm publish --access public
name: Upload to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

33 changes: 0 additions & 33 deletions appveyor.yml

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"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",
"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",
"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",
"upload": "node ./script/upload.js",
"postpublish": "git push --follow-tags"
"upload": "node ./script/upload.js"
},
"devDependencies": {
"babel-core": "^6.26.3",
Expand Down

0 comments on commit 6f5ea31

Please sign in to comment.