-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add
GitHub Package Manager
to release pipeline
- Loading branch information
1 parent
9d917e2
commit f948a42
Showing
1 changed file
with
53 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,13 @@ on: | |
push: | ||
branches: | ||
- main | ||
# workflow_dispatch: | ||
# inputs: | ||
# forceGPR: | ||
# description: Force GPR release | ||
# type: boolean | ||
# required: false | ||
# default: false | ||
workflow_dispatch: | ||
inputs: | ||
forceGPR: | ||
description: Force GPR release | ||
type: boolean | ||
required: false | ||
default: false | ||
|
||
jobs: | ||
install-deps: | ||
|
@@ -122,45 +122,49 @@ jobs: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
# gpr-release: | ||
# name: 🚀 Release to GitHub Package Manager | ||
# if: github.event.inputs.forceGPR == 'true' || needs.release.outputs.published == 'true' | ||
# runs-on: ubuntu-latest | ||
# needs: [build, release] | ||
# permissions: | ||
# contents: read | ||
# packages: write | ||
# steps: | ||
# - name: 🔑 Checkout Repository | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: 🔧 Install PNPM | ||
# uses: pnpm/[email protected] | ||
# with: | ||
# version: 7 | ||
|
||
# - name: ♻️ Load node_modules | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: "**/node_modules" | ||
# key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }} | ||
|
||
# - name: 🛠️ Setup Node for GPR | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: '16.14.2' | ||
# check-latest: true | ||
# cache: 'pnpm' | ||
# registry-url: 'https://npm.pkg.github.com' | ||
|
||
# - name: 📦 Install dependencies | ||
# if: steps.bun-cache.outputs.cache-hit != 'true' | ||
# run: bun install --frozen-lockfile | ||
|
||
# - name: ⚒️ Build package | ||
# run: bun run build | ||
|
||
# - name: 🚀 Publish to GPR | ||
# run: pnpm publish | ||
# env: | ||
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
gpr-release: | ||
name: 🚀 Release to GitHub Package Manager | ||
if: github.event.inputs.forceGPR == 'true' || needs.release.outputs.published == 'true' | ||
runs-on: ubuntu-latest | ||
needs: [build, release] | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: 🔑 Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🔧 Install Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
version: latest | ||
|
||
- name: ♻️ Load node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }} | ||
|
||
- name: 🛠️ Setup Node for GPR | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: latest | ||
check-latest: true | ||
registry-url: 'https://npm.pkg.github.com' | ||
|
||
- name: 👤 Set git user | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Luke Morales" | ||
- name: 📦 Install dependencies | ||
if: steps.bun-cache.outputs.cache-hit != 'true' | ||
run: bun install --frozen-lockfile | ||
|
||
- name: ⚒️ Build package | ||
run: bun run build | ||
|
||
- name: 🚀 Publish to GPR | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |