Update dev tag to latest #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update dev tag to latest | |
on: | |
workflow_dispatch: | |
inputs: | |
trigger-manual: | |
description: 'Manually trigger the workflow' | |
jobs: | |
update-tags: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: | |
# List the packages to run here. The matrix will run one job for each package parallelly. | |
- api-augment | |
- types | |
- config | |
- adapter | |
- sdk | |
steps: | |
- 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 npm info @oak-network/${{ matrix.package }} --fields dist-tags --json) | |
echo "Tag versions: $tags" | |
dev_version=$(echo $tags | jq -r '.["dist-tags"].dev') | |
echo "Dev tag version: $dev_version" | |
echo "::set-output name=dev_version::$dev_version" | |
- name: Point latest tag to ${{ steps.get-version.outputs.dev_version }} | |
run: | | |
npm dist-tag add @oak-network/${{ matrix.package }}@${{ steps.get-version.outputs.dev_version }} latest --registry=https://registry.npmjs.org/ | |
echo "Latest tag set to ${{ steps.get-version.outputs.dev_version }}" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN_CHRIS }} |