Skip to content
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
21 changes: 0 additions & 21 deletions .github/workflows/publish.yml

This file was deleted.

36 changes: 18 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ on:
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
permissions: "write-all"

steps:
- uses: actions/checkout@v4

Expand All @@ -32,23 +31,24 @@ jobs:
- name: Zip dist directory
run: cd dist && zip -r ../duke-prompts.zip .

- name: Create Release
- name: Create Release and Upload Asset
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
GH_REPO: ${{ github.repository }}
run: |
$TAG = ${{ github.ref }}.replace('refs/tags/', '')
gh release create $TAG 'duke-prompts.zip#Duke Prompts' --title "Release $TAG" --generate-notes

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm
uses: actions/checkout@v5

- name: Setup Node.js # Setup .npmrc file to publish to npm
uses: actions/setup-node@v4
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./duke-prompts.zip
asset_name: duke-prompts.zip
asset_content_type: application/zip
node-version: "20.x"
registry-url: "https://registry.npmjs.org/"
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading