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

On tag publish with GitHub Actions (GitHub Release + NPM) #334

Merged
merged 5 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't currently have access to add additional settings for this repository, so I can't merge this as-is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who can set it or grant you access?

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