Skip to content

Commit

Permalink
Continue setting up changeset (#401)
Browse files Browse the repository at this point in the history
- Created a version script
- Linked package versions
  • Loading branch information
alvarlagerlof committed Oct 8, 2023
1 parent df01d34 commit 5ed8752
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"linked": [
["@rsc-parser/chrome-extension", "@rsc-parser/core", "@rsc-parser/website"]
],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
Expand Down
7 changes: 7 additions & 0 deletions .changeset/heavy-stingrays-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@rsc-parser/chrome-extension": patch
"@rsc-parser/website": patch
"@rsc-parser/core": patch
---

Continued setting up changesets
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ jobs:

- name: Create Release Pull Request
uses: changesets/action@v1
with:
version: bash ./apply-version.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

16 changes: 16 additions & 0 deletions apply-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

# Step 1: Get the changeset status
yarn changeset status --output version.json

# Step 2: Extract newVersion from version.json
new_version=$(jq -r '.releases[0].newVersion' version.json)
echo "Found new version: $new_version"

# Step 3: Update the version in manifest.json
jq --arg version "$new_version" '.version = $version' packages/chrome-extension/public/manifest.json > tmp.json && mv tmp.json packages/chrome-extension/public/manifest.json
echo "Applied new version: $_new_version"

# Step 4: Clean up
rm version.json
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rsc-parser/core",
"version": "1.0.0",
"version": "0.1.2",
"main": "index.js",
"author": "Alvar Lagerlöf",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rsc-parser/website",
"version": "0.1.0",
"version": "0.1.2",
"license": "MIT",
"private": true,
"packageManager": "yarn@3.6.4",
Expand Down

0 comments on commit 5ed8752

Please sign in to comment.