Skip to content

Commit

Permalink
add flexible target commitish
Browse files Browse the repository at this point in the history
  • Loading branch information
timeowilliams committed Sep 23, 2024
1 parent d021573 commit d479276
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ on:
permissions:
contents: write
issues: write
pull-requests: read # Added read permission for pull requests
actions: read # Added read permission for actions

jobs:
publish:
runs-on: macos-latest # Ensure macOS for macOS builds
runs-on: macos-latest

steps:
# Checkout the code
Expand All @@ -35,7 +33,7 @@ jobs:
- name: Install node-pre-gyp-github
run: npm install -g node-pre-gyp-github

# Build macOS binary explicitly (optional, could be redundant with node-pre-gyp)
# Build macOS binary
- name: Build macOS binary
run: npm run build:macos

Expand All @@ -47,7 +45,7 @@ jobs:
- name: Publish binary to GitHub Releases
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.NODE_PRE_GYP_GITHUB_TOKEN }}
run: node-pre-gyp-github publish --release
run: node-pre-gyp-github publish --release --target_commitish="${{ github.ref_name }}"

# Set Git user identity (for version bump commit)
- name: Set Git user identity
Expand All @@ -62,14 +60,10 @@ jobs:
# Push version commit and tag to GitHub
- name: Push version commit and tag
run: |
git push origin main --tags
# Fetch all tags to make sure the latest tag is available
- name: Fetch all tags
run: git fetch --tags
git push origin ${{ github.ref_name }} --tags
# Publish to npm
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
run: npm publish --access public

0 comments on commit d479276

Please sign in to comment.