Skip to content

Commit

Permalink
feat(ci): add release github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cesconix committed Aug 6, 2024
1 parent 395ccbb commit c9cf42d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install
run: pnpm install --no-frozen-lockfile

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
enable-pre-post-scripts=true
package-manager-strict=false
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release PR or Publish to NPM
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
"build": "turbo build",
"dev": "turbo dev",
"biome": "biome check --no-errors-on-unmatched --files-ignore-unknown=true",
"changeset": "changeset",
"changeset:version": "changeset version",
"changeset:release": "changeset publish",
"release": "changeset publish",
"prepare": "husky"
},
"devDependencies": {
Expand Down

0 comments on commit c9cf42d

Please sign in to comment.