Skip to content

Release snapshot

Release snapshot #4

Workflow file for this run

name: Release snapshot
on:
workflow_dispatch:
inputs:
ref:
type: string
required: false
default: ''
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
publishedPackages: ${{ steps.package_list.outputs.LIST }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'
- name: Install Dependencies
run: yarn
- name: Snapshot
run: yarn changeset version --snapshot $REF
env:
REF: ${{ inputs.ref }}
- name: Collect all the packages
id: package_list
run: |
listChangedPackages () {
for filename in `git ls-files --modified | grep package.json`; do
cat "$filename" | jq -r '.name + "@" + .version'
done
}
echo 'LIST<<EOF' >> $GITHUB_OUTPUT
listChangedPackages | awk '{print "yarn add " $0}' >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
echo "NUMBER_OF_PACKAGES=$(git ls-files --modified | grep package.json | wc -l)" >> $GITHUB_OUTPUT
- name: Publish the snapshot
run: |
yarn changeset publish --tag alpha --no-git-tag --snapshot
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Output
run: |
echo $LIST >> $GITHUB_SUMMARY
env:
LIST: ${{ steps.package_list.outputs.LIST }}