Skip to content

Commit

Permalink
chore: simplify action
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Sep 27, 2024
1 parent d3fde8b commit 0b94eab
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,38 @@ on:
type: choice
description: Package name (npm)
options:
- "next-auth"
- "@auth/core"
- "@auth/express"
- "@auth/nuxt"
- "@auth/qwik"
- "@auth/solid-start"
- "@auth/sveltekit"
- "@auth/azure-tables-adapter"
- "@auth/d1-adapter"
- "@auth/dgraph-adapter"
- "@auth/drizzle-adapter"
- "@auth/dynamodb-adapter"
- "@auth/edgedb-adapter"
- "@auth/fauna-adapter"
- "@auth/firebase-adapter"
- "@auth/hasura-adapter"
- "@auth/kysely-adapter"
- "@auth/mikro-orm-adapter"
- "@auth/mongodb-adapter"
- "@auth/neo4j-adapter"
- "@auth/pg-adapter"
- "@auth/pouchdb-adapter"
- "@auth/prisma-adapter"
- "@auth/sequelize-adapter"
- "@auth/supabase-adapter"
- "@auth/surrealdb-adapter"
- "@auth/test-adapter"
- "@auth/typeorm-adapter"
- "@auth/typeorm-legacy-adapter"
- "@auth/unstorage-adapter"
- "@auth/upstash-redis-adapter"
- "@auth/xata-adapter"
- "next-auth"
# TODO: Infer from package name
path:
type: choice
description: Directory name (packages/*)
options:
- "core"
- "frameworks-nextjs"
- "adapter-edgedb"
- "adapter-dgraph"
- "adapter-drizzle"
- "adapter-dynamodb"
- "adapter-fauna"
- "adapter-firebase"
- "adapter-hasura"
- "adapter-mikro-orm"
- "adapter-mongodb"
- "adapter-neo4j"
- "adapter-pouchdb"
- "adapter-prisma"
- "adapter-sequelize"
- "adapter-supabase"
- "adapter-surrealdb"
- "adapter-typeorm"
- "adapter-unstorage"
- "adapter-upstash-redis"
- "adapter-xata"
- "next-auth"

permissions:
id-token: write

Expand Down Expand Up @@ -234,11 +218,29 @@ jobs:
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Map package name to path
run: |
case "${{ github.event.inputs.name }}" in
*"-adapter")
adapter_name=$(echo "${{ github.event.inputs.name }}" | sed 's/@auth\///' | sed 's/-adapter//')
echo "PACKAGE_PATH=adapter-${adapter_name}" >> $GITHUB_ENV
;;
"next-auth")
echo "PACKAGE_PATH=next-auth" >> $GITHUB_ENV
;;
"@auth/core")
echo "PACKAGE_PATH=core" >> $GITHUB_ENV
;;
*)
framework_name=$(echo "${{ github.event.inputs.name }}" | sed 's/@auth\///')
echo "PACKAGE_PATH=frameworks-${framework_name}" >> $GITHUB_ENV
;;
esac
- name: Determine version
uses: ./.github/version-pr
id: determine-version
env:
PACKAGE_PATH: ${{ github.event.inputs.path }}
PACKAGE_PATH: ${{ env.PACKAGE_PATH }}
- name: Publish to npm
run: |
pnpm build
Expand All @@ -249,5 +251,5 @@ jobs:
echo "Install via: pnpm add ${{ github.event.inputs.name }}@${{ env.VERSION }}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PACKAGE_PATH: ${{ github.event.inputs.path }}
PACKAGE_PATH: ${{ env.PACKAGE_PATH }}
VERSION: ${{ steps.determine-version.outputs.version }}

0 comments on commit 0b94eab

Please sign in to comment.