Skip to content

Commit

Permalink
fix: use npm publish instead of semantic release for experimental ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
ankur-arch committed Nov 27, 2024
1 parent 1d9514e commit 9000ca5
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/preview-publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Preview Release on PR
name: Publish Experimental Release
on:
pull_request:
branches:
- main
permissions:
contents: write # Required for publishing releases
jobs:
preview-release:
name: Preview Dev Release
experimental-release:
name: Experimental Dev Release
runs-on: ubuntu-latest
permissions:
contents: write # For publishing to GitHub releases
Expand Down Expand Up @@ -56,20 +56,12 @@ jobs:
- name: Audit Dependencies
run: npm audit signatures

# Step 10: Generate and log preview release version
- name: Generate and Log Preview Release Version
id: preview_version
run: |
VERSION="0.0.0-pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD)"
echo "Preview release version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
# Step 10: Set experimental version
- name: Set Experimental Version
run: npm version --no-git-tag-version 0.0.0-experimental-${GITHUB_SHA::7}

# Step 11: Create a preview release
- name: Publish Preview Release
# Step 11: Publish Experimental Release
- name: Publish Experimental Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_NUXT_TOKEN }}
VERSION: ${{ env.VERSION }}
run: |
echo "Publishing preview release $VERSION"
npx semantic-release --no-ci --branches main --tag-format "v${VERSION}"
NODE_AUTH_TOKEN: ${{ secrets.NPM_NUXT_TOKEN }}
run: npm publish --access public --tag experimental

0 comments on commit 9000ca5

Please sign in to comment.