Update snapshots for pug-graph #27
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: Changesets | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
changesets: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install pnpm | |
id: pnpm-install | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | |
- name: Setup pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Setup npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
EOF | |
- name: Create release PR or publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm -r publish | |
createGithubReleases: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
#- name: DEBUG Emulate changesets publish action | |
# id: changesets | |
# run: | | |
# pnpm -r coverage | |
# data='[{"name": "@macropygia/vite-plugin-imagemin-cache", "version": "0.0.0"}, {"name": "@macropygia/vite-plugin-pug-static", "version": "0.0.0"}]' | |
# echo "::set-output name=publishedPackages::$data" | |
# echo "::set-output name=published::true" | |
# Waiting for pnpm support for changesets | |
# - name: DEBUG / Show changesets outputs | |
# run: | | |
# echo ${{ steps.changesets.outputs.published }} | |
# echo ${{ steps.changesets.outputs.publishedPackages }} | |
# - name: Convert publishedPackages to comma separated string using jq | |
# id: jq | |
# if: steps.changesets.outputs.published == 'true' | |
# run: | | |
# flags=`echo '${{ steps.changesets.outputs.publishedPackages }}' | jq '.[].name | split("/") | .[1]' | jq -s -j 'join(",")'` | |
# echo "::set-output name=codecovFlags::$flags" | |
# files=`echo '${{ steps.changesets.outputs.publishedPackages }}' | jq '.[].name | split("/") | .[1]' | jq -s -j 'map("packages/" + . + "/coverage/coverage-final.json") | join(",")'` | |
# echo "::set-output name=codecovFiles::$files" | |
# - name: Upload coverage to Codecov | |
# if: steps.changesets.outputs.published == 'true' | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# flags: ${{ steps.jq.outputs.codecovFlags }} | |
# files: ${{ steps.jq.outputs.codecovFiles }} | |
# # verbose: true | |
# # dry_run: true |