Skip to content

Commit

Permalink
fix: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
grikomsn committed Nov 8, 2024
1 parent 4dc50fb commit 3fdbb4f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ jobs:
with:
cache: "pnpm"
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: pnpm install --frozen-lockfile
# - name: Check for lint errors
# run: pnpm check
- name: Build package
run: pnpm build
- name: Set outputs
Expand All @@ -45,6 +44,19 @@ jobs:
run: pnpm publish --no-git-checks --tag alpha ${{ inputs.dry_run && '--dry-run' || '' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup Node with GPR
uses: actions/setup-node@v4
with:
cache: "pnpm"
node-version-file: ".nvmrc"
registry-url: "https://npm.pkg.github.com"
scope: "@grikomsn"
- name: Rename package for GPR
run: node scripts/rename-gpr-package.js
- name: Publish package on GPR
run: pnpm publish --no-git-checks --tag alpha ${{ inputs.dry_run && '--dry-run' || '' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Pack package (dry run)
if: ${{ inputs.dry_run }}
run: |
Expand Down
11 changes: 11 additions & 0 deletions scripts/rename-gpr-package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fs = require("fs/promises");
const path = require("path");

async function script() {
const packageJson = require("../package.json");
packageJson.name = "@grikomsn/yaak-plugin-base64";
const dest = path.resolve(__dirname, "../package.json");
await fs.writeFile(dest, `${JSON.stringify(packageJson, null, 2)}\n`);
}

void script();

0 comments on commit 3fdbb4f

Please sign in to comment.