Skip to content

Commit

Permalink
A couple more tweaks (#21)
Browse files Browse the repository at this point in the history
1 - Added `v` back to GitHub release tag

2 - Identified a few more spots the `master` branch was used

3 - Added tests and lint to the simple publisher.
  • Loading branch information
NorthernMan54 committed Mar 28, 2024
1 parent fed3c01 commit d967940
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/Build and Publish.yml
@@ -1,4 +1,4 @@
name: "Build and Publish"
name: "Build, Test and Publish"

# Simple automated publishing for projects

Expand All @@ -15,7 +15,7 @@ name: "Build and Publish"
# 4 - As updates are made to the beta branch, npm beta releases will be created.
# 5 - Once the release is complete, and ready for latest/production release, create a pull request to merge the changes into the `latest` branch.
# 6 - After reviews are complete, merge the pull request
# 7 - For the latest/production release, the workflow must be manually kicked off / started from Actions --> Build and Publish
# 7 - For the latest/production release, the workflow must be manually kicked off / started from Actions --> Build, Test and Publish
# 8 - Delete beta branch

on:
Expand Down Expand Up @@ -49,18 +49,31 @@ jobs:
BRANCH_NAME: ${{ steps.get_branch.outputs.BRANCH_NAME }}
TARGET_IMAGE_TAG: ${{ steps.get_tag.outputs.TARGET_IMAGE_TAG }}

build_and_test:
uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
enable_coverage: true
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
lint:
needs: build_and_test
uses: homebridge/.github/.github/workflows/eslint.yml@latest
lint-docs:
needs: build_and_test
uses: homebridge/.github/.github/workflows/lint-docs.yml@latest

publish_prod_release:
needs: get_tags
needs: [get_tags, lint, lint-docs]
name: Publish Release Version
if: ${{ needs.get_tags.outputs.BRANCH_NAME == 'latest' }}
uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
with:
install_cmd: npm ci
secrets:
npm_auth_token: ${{ secrets.npm_token }}
npm_auth_token: ${{ secrets.NPM_TOKEN }}

publish_test:
needs: get_tags
needs: [get_tags, lint, lint-docs]
name: Publish Test Version - ${{ needs.get_tags.outputs.BRANCH_NAME }}
if: ${{ needs.get_tags.outputs.BRANCH_NAME != 'latest' }}
uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
Expand All @@ -70,7 +83,7 @@ jobs:
npm_version_command: 'pre'
pre_id: ${{ needs.get_tags.outputs.TARGET_IMAGE_TAG }}
secrets:
npm_auth_token: ${{ secrets.npm_token }}
npm_auth_token: ${{ secrets.NPM_TOKEN }}

publish_github_release:
needs: [publish_prod_release]
Expand All @@ -82,8 +95,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
name: Release ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
tag_name: v${{ needs.publish_prod_release.outputs.NPM_VERSION }}
name: Release v${{ needs.publish_prod_release.outputs.NPM_VERSION }}
generate_release_notes: true
draft: false
prerelease: false
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -2,10 +2,10 @@ name: "CodeQL"

on:
push:
branches: [ master ]
branches: [ latest ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ latest ]
schedule:
- cron: '35 12 * * 2'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
@@ -1,7 +1,7 @@
name: Node Build
on:
push:
branches: [master]
branches: [latest]
pull_request:
workflow_dispatch:

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "bonjour-hap",
"version": "3.7.1",
"version": "3.7.2",
"description": "A Bonjour/Zeroconf implementation in pure JavaScript (for HAP)",
"main": "index.js",
"author": "Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",
Expand Down

0 comments on commit d967940

Please sign in to comment.