chore(patch): Release v0.55.1 #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto-publish | |
on: | |
push: | |
branches: | |
- master | |
- next | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
changed: ${{ steps.check.outputs.changed }} | |
version: ${{ steps.check.outputs.version }} | |
commit: ${{ steps.check.outputs.commit }} | |
beta: ${{ startsWith(steps.check.outputs.type, 'pre') }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Check version changes | |
uses: EndBug/version-check@v2 | |
id: check | |
latest: | |
name: Publish Latest | |
runs-on: ubuntu-latest | |
needs: check | |
if: contains(github.ref, 'master') && needs.check.outputs.changed == 'true' && needs.check.outputs.beta != 'true' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ needs.check.outputs.commit }} | |
- name: Parse Changelog # Exits if changelog not found | |
id: changelog | |
env: | |
INPUT_VERSION: ${{ needs.check.outputs.version }} | |
run: node ./scripts/changelog/index.cjs | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: npm install | |
- name: Publish to NPM | |
run: npm publish # Publish builds automatically | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Tag and Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.check.outputs.version }} | |
target_commitish: ${{ needs.check.outputs.commit }} | |
body: ${{ steps.changelog.outputs.changes }} | |
files: | | |
dist/* | |
changelog.md | |
beta: | |
name: Publish Beta | |
runs-on: ubuntu-latest | |
needs: check | |
if: contains(github.ref, 'next') && needs.check.outputs.changed == 'true' && needs.check.outputs.beta == 'true' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ needs.check.outputs.commit }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: npm install | |
- name: Publish to NPM | |
run: npm publish --tag next # Publish builds automatically | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |