Skip to content

Commit

Permalink
n
Browse files Browse the repository at this point in the history
  • Loading branch information
OrJDev committed Sep 24, 2024
1 parent 31c9899 commit a0197ad
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/changeset-version.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// ORIGINALLY FROM CLOUDFLARE WRANGLER:
// https://github.com/cloudflare/wrangler2/blob/main/.github/changeset-version.js

const { exec } = require("child_process");
import { exec } from "child_process";
// This script is used by the `release.yml` workflow to update the version of the packages being released.
// The standard step is only to run `changeset version` but this does not update the package-lock.json file.
// So we also run `npm install`, which does this update.
// This is a workaround until this is handled automatically by `changeset version`.
// See https://github.com/changesets/changesets/issues/421.
exec("pnpm changeset version");
exec("pnpm i --lockfile-only");
exec("pnpm i --lockfile-only --no-frozen-lockfile");
34 changes: 24 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,48 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2.2.4
with:
version: 7
- uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: "pnpm"

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
EOF
- name: Verify NPM Authentication
continue-on-error: true
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm whoami
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
run: pnpm install

- name: Build
run: pnpm build
- name: Test
run: pnpm test

- name: Create Release
uses: changesets/action@v1.4.1
uses: changesets/action@v1.4.7
with:
commit: "chore(release): 📦 version packages"
title: "chore(release): 📦 version packages"
title: "chore(release): 📦 version packages"
version: node .github/changeset-version.js
publish: pnpm changeset publish
env:
Expand Down

0 comments on commit a0197ad

Please sign in to comment.