Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Github Actions caused by the new yarn berry version #112

Merged
merged 9 commits into from
Dec 5, 2023
20 changes: 14 additions & 6 deletions .github/workflows/npm-publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ jobs:
- name: 🤘 checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install Yarn v2
run: npm install -g yarn@berry

- name: Install dependencies
run: yarn install

Expand All @@ -36,16 +44,16 @@ jobs:
id: get-current-dev-version
run: |
# Get the dev tag version
tags=$(yarn info @oak-network/${{ matrix.package }} dist-tags --json)
tags=$(yarn npm info @oak-network/${{ matrix.package }} --fields dist-tags --json)
echo "Tag versions: $tags"
current_dev_version=$(echo $tags | jq -r '.data.dev')
current_dev_version=$(echo $tags | jq -r '.["dist-tags"].dev')
echo "Dev tag version: $current_dev_version"
echo "current_dev_version=$current_dev_version" >> "$GITHUB_ENV"

# Get the latest version;
all_versions=$(yarn info @oak-network/${{ matrix.package }} versions --json)
echo "All versions: $all_versions"
highest_version=$(echo "$all_versions" | jq -r '.data[]' | sort -V | tail -n1)
# Get the latest version
all_versions=$(yarn npm info @oak-network/${{ matrix.package }} --fields versions --json)
echo "All versions: $all_versions"
highest_version=$(echo "$all_versions" | jq -r '.versions[]' | sort -V | tail -n1)
echo "Highest version: $highest_version"
echo "highest_version=$highest_version" >> "$GITHUB_ENV"

Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
- name: checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install Yarn v2
run: npm install -g yarn@berry

- name: Install dependencies
run: yarn install
Expand All @@ -24,6 +32,7 @@ jobs:

- name: Create Release Pull Request
uses: changesets/action@v1
continue-on-error: true
with:
title: Changeset Version Bump
commit: Update the version of packages with .changeset md files
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/update-package-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install Yarn v2
run: npm install -g yarn@berry

- name: 🔐 Authenticate with NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTOMATION_TOKEN_CHRIS }}" > ~/.npmrc

- name: Get dev version of ${{ matrix.package }}
id: get-version
run: |
tags=$(yarn info @oak-network/${{ matrix.package }} dist-tags --json)
tags=$(yarn npm info @oak-network/${{ matrix.package }} --fields dist-tags --json)
echo "Tag versions: $tags"
dev_version=$(echo $tags | jq -r '.data.dev')
dev_version=$(echo $tags | jq -r '.["dist-tags"].dev')
echo "Dev tag version: $dev_version"
echo "::set-output name=dev_version::$dev_version"

Expand Down
Binary file modified .yarn/install-state.gz
Binary file not shown.
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-stable-temp.cjs

This file was deleted.

4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs

enableImmutableInstalls: false # turn off this to allow yarn to update the yarn.lock file; this is to prevent yarn install from interruption in the Release Github Actions
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
"prepare": "husky install"
},
"devDependencies": {
"@babel/preset-env": "^7.19.4",
"@babel/core": "^7.23.5",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This @babel/core dependency was necessary but missing, causing yarn install error.

"@babel/preset-env": "^7.23.5",
"@babel/preset-typescript": "^7.18.6",
"@changesets/cli": "^2.26.2",
"@types/babel__core": "^7",
"@types/jest": "^29.5.4",
"@types/lodash": "^4.14.191",
"@types/node": "^20.10.3",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This @types/node dependency was necessary but missing, causing yarn install error.

"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"eslint": "^8.50.0",
Expand All @@ -55,5 +58,6 @@
"eslint --fix"
],
"*.ts": "eslint --cache --fix"
}
},
"packageManager": "[email protected]"
}
Loading