update workflow

This commit is contained in:
Adam Matthiesen 2024-02-14 03:41:33 -08:00
parent e33707f8cb
commit bbd0c81619
2 changed files with 29 additions and 20 deletions

View File

@ -1,29 +1,38 @@
name: Release name: Changesets
on: on:
push: push:
branches: branches:
- main - main
concurrency: ${{ github.workflow }}-${{ github.ref }} env:
permissions: {} #reset CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs: jobs:
release: version:
# IMPORTANT: prevent this action from running on forks timeout-minutes: 15
if: github.repository == 'MatthiesenXYZ/astro-ghostcms'
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
name: Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: checkout code repository
- uses: actions/setup-node@v4 uses: actions/checkout@v3
with: with:
node-version: 20 fetch-depth: 0
- name: Publish to npm - name: setup node.js
id: changesets uses: actions/setup-node@v3
with:
node-version: 14
- name: install pnpm
run: npm i pnpm@latest -g
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: install dependencies
run: pnpm install
- name: create and publish versions
uses: changesets/action@v1 uses: changesets/action@v1
with: with:
publish: npm run release version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@ -7,8 +7,8 @@
}, },
"scripts": { "scripts": {
"lint": "biome check .", "lint": "biome check .",
"changeset": "changeset", "ci:version": "pnpm changeset version",
"release": "changeset publish", "vi:publish": "pnpm changeset publish",
"lint:fix": "biome check --apply .", "lint:fix": "biome check --apply .",
"playground:dev": "pnpm --filter playground dev", "playground:dev": "pnpm --filter playground dev",
"api:test": "pnpm --filter astro-ghostcms test", "api:test": "pnpm --filter astro-ghostcms test",