Skip to content

Commit

Permalink
feat(ci): adds github release on tag push
Browse files Browse the repository at this point in the history
  • Loading branch information
m1dugh committed Aug 14, 2023
1 parent ce662fa commit 9da328e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,24 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
check_version:
name: Check version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install jq
run: |
sudo apt update -y
sudo apt install -y jq
- name: Check npm version corresponds to tag
shell: bash
run: |
tag_version=$(echo $GITHUB_REF_NAME | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+(-.+)?")
npm_version=$(jq -r '.version' ./package.json)
exit [ "$tag_version" = "$npm_version" ]
lint:
needs:
- check_version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -69,6 +86,8 @@ jobs:
publish:
needs: [win-build, linux-build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -96,6 +115,16 @@ jobs:
working-directory: ./dist/addons/
run: test -f linux-sound-mixer.node && test -f win-sound-mixer.node
- name: Publish package to npm registry
id: publish_package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create compressed folder release
run: |
tar -cvf ./release.tar.gz ./dist/ ./package.json
- name: Create github release
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: "release.tar.gz"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "native-sound-mixer",
"version": "3.4.1-win",
"version": "3.4.2-win",
"description": "node js native sound mixer module",
"main": "dist/sound-mixer.js",
"scripts": {
Expand Down

0 comments on commit 9da328e

Please sign in to comment.