Skip to content

Commit

Permalink
🤖 Create CI Release (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Aug 7, 2023
1 parent 0536fa7 commit 68701c0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install
- run: npm run build
- run: npm run test
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: npm run version
publish: npm run publish:ci
commit: 🚀 Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Send a Slack notification if a publish happens
if: steps.changesets.outputs.published == 'true'
run: echo "A new version of ${GITHUB_REPOSITORY} was published!"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"prepublishOnly": "npm run build",
"changeset": "changeset",
"version": "changeset version && npm install",
"publish": "npm run clean && npm run build -- --force && changeset publish && git push --follow-tags"
"publish": "npm run clean && npm run build -- --force && changeset publish && git push --follow-tags",
"publish:ci": "npm run clean && npm run build && changeset publish && git push --follow-tags"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
Expand Down

0 comments on commit 68701c0

Please sign in to comment.