Skip to content

Commit

Permalink
ci: adjustments to gpm release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemorales committed Feb 2, 2024
1 parent a086a4e commit f86891e
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:
inputs:
force_github_package_release:
description: Force GPR release
description: Force GPM release
type: boolean
required: false
default: false
Expand Down Expand Up @@ -97,9 +97,9 @@ jobs:
key: ${{ runner.os }}-build-${{ hashFiles('**/bun.lockb') }}

- name: 🛠️ Setup Node for NPM
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: latest
node-version: '20.x'
check-latest: true
registry-url: 'https://registry.npmjs.org'

Expand All @@ -122,14 +122,14 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

gpr-release:
gpm-release:
name: 🚀 Release to GitHub Package Manager
if: ${{ github.event.inputs.force_github_package_release != 'true' || needs.release.outputs.published == 'true' }}
runs-on: ubuntu-latest
needs: [build, release]
needs: [build]
permissions:
contents: read
packages: write
contents: read
steps:
- name: 🔑 Checkout Repository
uses: actions/checkout@v4
Expand All @@ -145,27 +145,26 @@ jobs:
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }}

- name: 🛠️ Setup Node for GPR
uses: actions/setup-node@v3
- name: ♻️ Load build files
uses: actions/cache@v4
with:
node-version: latest
path: "**/dist"
key: ${{ runner.os }}-build-${{ hashFiles('**/bun.lockb') }}

- name: 🛠️ Setup Node for GPM
uses: actions/setup-node@v4
with:
node-version: '20.x'
check-latest: true
registry-url: 'https://npm.pkg.github.com'

- name: 👤 Set git user
run: |
git config --global user.email "lukemorales@live.com"
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
- name: 🚀 Publish to GPM
run: |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> .npmrc
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit f86891e

Please sign in to comment.