Skip to content

Commit

Permalink
Updated Github Actions using yarn berry version
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisli30 committed Dec 5, 2023
1 parent fc86b5b commit b0914e4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
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
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
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

0 comments on commit b0914e4

Please sign in to comment.