Skip to content

Commit

Permalink
Add changeset-release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
robertherber committed Oct 15, 2023
1 parent 4d88550 commit 0464ab4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 32 deletions.
59 changes: 28 additions & 31 deletions .github/workflows/autopublish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
# name: NPM Autopublish
# run-name: Autopublish
name: Release

# on:
# push:
# branches:
# - main
on:
push:
branches:
- main

# jobs:
# test:
# uses: ./.github/workflows/test.yml
concurrency: ${{ github.workflow }}-${{ github.ref }}

# publish-to-npm:
# needs: [ test ]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: oven-sh/setup-bun@v1
# - run: git config user.name "$(git log -n 1 --pretty=format:%an)"
# - run: git config user.email "$(git log -n 1 --pretty=format:%ae)"
# - run: bun install
# - run: echo "versionTag=`npm version patch -m "%s - autorelease"`" >> $GITHUB_ENV
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.npm_token}}
# - run: git push --follow-tags --no-verify
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# name: ${{ env.versionTag }} - autorelease
# tag_name: ${{ env.versionTag }}
# generate_release_notes: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- uses: oven-sh/setup-bun@v1

- run: bun install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: bunx changeset-release

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"prepare": "husky install",
"pre-push": "bunx turbo run lint-quiet test typecheck",
"generate-cms-json-schema": "typescript-json-schema ./packages/cms/tsconfig.json CmsConfigFile --include ./packages/cms/types.ts --out ./packages/cms/entities-json-schema.json --required --strictNullChecks --rejectDateType",
"fix-workspace-dependencies": "find . -type f -name 'package.json' -not -path './package.json' -not -path '*/node_modules/*' -exec perl -pi -e 's/\"workspace:[^\"]*\"/\"*\"/g' {} \\;"
"fix-workspace-dependencies": "find . -type f -name 'package.json' -not -path './package.json' -not -path '*/node_modules/*' -exec perl -pi -e 's/\"workspace:[^\"]*\"/\"*\"/g' {} \\;",
"changeset-release": "bun run fix-workspace-dependencies && bunx changeset publish"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit 0464ab4

Please sign in to comment.