Skip to content

Bump braces from 3.0.2 to 3.0.3 #3

Bump braces from 3.0.2 to 3.0.3

Bump braces from 3.0.2 to 3.0.3 #3

name: Release - Canary
on:
pull_request:
types: [labeled]
branches:
- main
jobs:
release:
if: contains(github.event.pull_request.labels.*.name, 'release canary')
name: Build & Publish a canary release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use PNPM
uses: pnpm/[email protected]
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- 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 deps (with cache)
run: pnpm install
- name: Check packages for common errors
run: pnpm lint
- name: Bump version to canary
run: node .github/canary-version.mjs
- name: Authenticate to npm and publish
run: |
pnpm build
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
pnpm publish --access public --tag canary --no-git-checks
- name: Create a new comment notifying of the new canary version
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Get package version
const fs = require("fs");
const packageJson = JSON.parse(fs.readFileSync("./package.json"));
const version = packageJson.version;
// Create a comment on the PR with the new canary version
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: `A new canary is available for testing. You can install this latest build in your project with:
\`\`\`sh
pnpm add gitsubclone@${version}
\`\`\`
`,
})
// Remove the label
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
name: 'release canary',
});